]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix a memory leak when processing archives.
authorNick Clifton <nickc@redhat.com>
Fri, 17 Nov 2017 12:44:16 +0000 (12:44 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 17 Nov 2017 12:46:07 +0000 (12:46 +0000)
PR 22449
* ar.c (write_archive): Free the temporary file name.

binutils/ChangeLog
binutils/ar.c

index 16e93d763ac9117ac7eb7a07d4bde88e22111a1f..caf9647e4a89ee45af9d5a22114eb467e66c2522 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-17  Nick Clifton  <nickc@redhat.com>
+
+       PR 22449
+       * ar.c (write_archive): Free the temporary file name.
+
 2017-11-17  Nick Clifton  <nickc@redhat.com>
 
        * readelf.c (process_archive): Include member name in the
index 25f3b3d0bf0318af1279314a2a40c5b840a96bf0..9de0d13be1413c80607c1acff6538f4fdff432e8 100644 (file)
@@ -1197,6 +1197,7 @@ write_archive (bfd *iarch)
   if (smart_rename (new_name, old_name, 0) != 0)
     xexit (1);
   free (old_name);
+  free (new_name);
 }
 
 /* Return a pointer to the pointer to the entry which should be rplacd'd