This fixes some objcopy memory leaks. commit
450da4bd38ae used
xatexit to tidy most of the hash table memory, but of course that's
ineffective without a call to xexit. The other major memory leak
happens if there is an error of some sort writing the output file, due
to not closing the input file and thus not freeing memory attached to
the bfd.
* objcopy.c (copy_file): Don't return when bfd_close of output
gives an error, always bfd_close input too.
(main): Call xexit.
{
status = 1;
bfd_nonfatal_message (output_filename, NULL, NULL, NULL);
- return;
}
if (!bfd_close (ibfd))
{
status = 1;
bfd_nonfatal_message (input_filename, NULL, NULL, NULL);
- return;
}
}
else
END_PROGRESS (program_name);
+ xexit (status);
return status;
}