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 16e93d7..caf9647 100644 (file)
@@ -1,5 +1,10 @@
 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
        file_name of the filedata structure.
 
index 25f3b3d..9de0d13 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