coff object_p memory leaks

* coffgen.c (coff_real_object_p): Free malloc'd memory on failure.
This commit is contained in:
Alan Modra 2019-12-30 21:17:08 +10:30
parent 6a89db5c95
commit 37d5ab199b
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2019-12-30 Alan Modra <amodra@gmail.com>
* coffgen.c (coff_real_object_p): Free malloc'd memory on failure.
2019-12-30 Alan Modra <amodra@gmail.com>
* archive.c (do_slurp_bsd_armap): Use bfd_alloc rather than

View File

@ -305,6 +305,9 @@ coff_real_object_p (bfd *abfd,
return abfd->xvec;
fail:
obj_coff_keep_syms (abfd) = FALSE;
obj_coff_keep_strings (abfd) = FALSE;
_bfd_coff_free_symbols (abfd);
bfd_release (abfd, tdata);
fail2:
abfd->tdata.any = tdata_save;