* bucomm.c (make_tempname): Stop memory leak.
authorNick Clifton <nickc@redhat.com>
Fri, 25 Mar 2011 17:51:10 +0000 (17:51 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 25 Mar 2011 17:51:10 +0000 (17:51 +0000)
ICVS: ----------------------------------------------------------------------

binutils/ChangeLog
binutils/bucomm.c

index d17deffb38b45b2cc5ef785fa6726c3b2ea6f568..1497663219e7e284a6a5198ce8d560b6bf941e88 100644 (file)
@@ -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>
 
index 77afc1084a830683a10dd421ea23c9b166f82e13..9977b50137f8904b21edd458daa4ce387c180377 100644 (file)
@@ -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;
 }