Fix ridiculously small memory leak.

PR 24001
	* objcopy.c (copy_object): Free dhandle after writing out the
	debug information.
	* objdump.c (dump_bfd): Free dhandle after printing out the debug
	information.
This commit is contained in:
Nick Clifton 2019-01-04 12:11:51 +00:00
parent 677bd4c69d
commit cf0ad5bbf2
3 changed files with 18 additions and 1 deletions

View file

@ -3087,7 +3087,14 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
if (convert_debugging && dhandle != NULL)
{
if (! write_debugging_info (obfd, dhandle, &symcount, &osympp))
bfd_boolean res;
res = write_debugging_info (obfd, dhandle, &symcount, &osympp);
free (dhandle);
dhandle = NULL; /* Paranoia... */
if (! res)
{
status = 1;
return FALSE;