Fix thinko in objcopy's memory freeing code.
authorFrederic Cambus <fred@statdns.com>
Tue, 26 Jan 2021 09:55:34 +0000 (09:55 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 26 Jan 2021 09:55:34 +0000 (09:55 +0000)
* objcopy.c (copy_main): Fix a double free happening when both
--localize-symbols and --globalize-symbols options are invoked
together.

binutils/ChangeLog
binutils/objcopy.c

index b0a8da7a2df7fb4ed189e4c21d46b57f3ccd892e..fd9f4bda8c28eb1dd5995016e3d1282325815a03 100644 (file)
@@ -1,3 +1,9 @@
+2021-01-26  Frederic Cambus  <fred@statdns.com>
+
+       * objcopy.c (copy_main): Fix a double free happening when both
+       --localize-symbols and --globalize-symbols options are invoked
+       together.
+
 2021-01-24  Nick Clifton  <nickc@redhat.com>
 
        * README-how-to-make-a-release: Minor updates after the 2.36 release.
index 62ee22202ff59fa0d7b932b049fd59d36be9d5eb..a5cead1cf8e602c377fac82f3020c9ba4eb88ac1 100644 (file)
@@ -6018,7 +6018,7 @@ copy_main (int argc, char *argv[])
     free (keep_specific_buffer);
 
   if (localize_specific_buffer)
-    free (globalize_specific_buffer);
+    free (localize_specific_buffer);
 
   if (globalize_specific_buffer)
     free (globalize_specific_buffer);