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.
This commit is contained in:
Alan Modra 2022-08-16 00:16:49 +09:30
parent 105afa7f23
commit 450da4bd38
3 changed files with 43 additions and 28 deletions

View file

@ -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