aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Cambus <fred@statdns.com>2021-01-26 09:55:34 +0000
committerAlan Modra <amodra@gmail.com>2021-01-27 08:55:17 +1030
commitb1e65c1026ab07203367a099b2d3b29efb3e0ba1 (patch)
tree5147e787e08da010d36eddf8b7bfeb3252934e15
parentPR27218, memory access violation in dwarf2dbg.c (diff)
downloadbinutils-gdb-b1e65c1026ab07203367a099b2d3b29efb3e0ba1.tar.gz
binutils-gdb-b1e65c1026ab07203367a099b2d3b29efb3e0ba1.tar.bz2
binutils-gdb-b1e65c1026ab07203367a099b2d3b29efb3e0ba1.zip
Fix thinko in objcopy's memory freeing code.
* objcopy.c (copy_main): Fix a double free happening when both --localize-symbols and --globalize-symbols options are invoked together. (cherry picked from commit e37709f0901fe6f2410094151002bab3d123df85)
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/objcopy.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 4b6cd9f755..b701b69ecb 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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-01 Alan Modra <amodra@gmail.com>
Apply from master
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 3866c7f458..b730b25ff5 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -5953,7 +5953,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);