aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-03-25 17:51:10 +0000
committerNick Clifton <nickc@redhat.com>2011-03-25 17:51:10 +0000
commitc48d800e1527375235d7030199eb284228e4c55c (patch)
tree08d56d95c4c7c3cdc05edd5f8cc7f48fb19ede0f
parent4b41844bd9fdecbdc78d288f7d6b3012fee49b17 (diff)
downloadgdb-c48d800e1527375235d7030199eb284228e4c55c.zip
gdb-c48d800e1527375235d7030199eb284228e4c55c.tar.gz
gdb-c48d800e1527375235d7030199eb284228e4c55c.tar.bz2
* bucomm.c (make_tempname): Stop memory leak.
ICVS: ----------------------------------------------------------------------
-rw-r--r--binutils/ChangeLog1
-rw-r--r--binutils/bucomm.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index d17deff..1497663 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -19,6 +19,7 @@
(parse_stab_members): Likewise.
(stab_demangle_qualified): Likewise.
* objdump.c (dump_reloc_set): Free malloced memory.
+ * bucomm.c (make_tempname): Stop memory leak.
2011-03-25 Pierre Muller <muller@ics.u-strasbg.fr>
diff --git a/binutils/bucomm.c b/binutils/bucomm.c
index 77afc10..9977b50 100644
--- a/binutils/bucomm.c
+++ b/binutils/bucomm.c
@@ -511,7 +511,10 @@ make_tempname (char *filename)
fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600);
#endif
if (fd == -1)
- return NULL;
+ {
+ free (tmpname);
+ return NULL;
+ }
close (fd);
return tmpname;
}