diff options
author | 2021-01-26 09:55:34 +0000 | |
---|---|---|
committer | 2021-01-27 08:55:17 +1030 | |
commit | b1e65c1026ab07203367a099b2d3b29efb3e0ba1 (patch) | |
tree | 5147e787e08da010d36eddf8b7bfeb3252934e15 | |
parent | PR27218, memory access violation in dwarf2dbg.c (diff) | |
download | binutils-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/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/objcopy.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 4b6cd9f755e..b701b69ecb0 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 3866c7f4588..b730b25ff56 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); |