diff options
author | Alan Modra <amodra@gmail.com> | 2022-08-16 00:16:49 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-08-16 00:25:10 +0930 |
commit | 450da4bd38ae529a6879baafe59b1e88507b5fd9 (patch) | |
tree | 7f7794e1b3bff3b9466a127cc10e296b6c9eeec3 /binutils/objdump.c | |
parent | 105afa7f230e5fed8f5a2eb28bc14d7696f5ac72 (diff) | |
download | gdb-450da4bd38ae529a6879baafe59b1e88507b5fd9.zip gdb-450da4bd38ae529a6879baafe59b1e88507b5fd9.tar.gz gdb-450da4bd38ae529a6879baafe59b1e88507b5fd9.tar.bz2 |
PR29362, some binutils memory leaks
2022-08-16 Alan Modra <amodra@gmail.com>
Cunlong Li <shenxiaogll@163.com>
PR 29362
* dwarf.c (free_debug_information): New function, extracted..
(free_debug_memory): ..from here.
(process_debug_info): Use it when before clearing out unit
debug_information. Clear all fields.
* objcopy.c (delete_symbol_htabs): New function.
(main): Call it via xatexit.
(copy_archive): Free "dir".
* objdump.c (free_debug_section): Free reloc_info.
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r-- | binutils/objdump.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c index 188c286..b34df53 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -4108,6 +4108,9 @@ free_debug_section (enum dwarf_section_display_enum debug) section->start = NULL; section->address = 0; section->size = 0; + free ((char*) section->reloc_info); + section->reloc_info = NULL; + section->num_relocs= 0; } void |