PR binutils/10785

* coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Don't bfd_alloc
	bim and bim->buffer.  bfd_malloc instead.
	* peicode.h (pe_ILF_build_a_bfd): Similarly.
	(ILF_DATA_SIZE): Don't include bim.
	* opncls.c (bfd_close): Test bim->buffer non-NULL before freeing.
This commit is contained in:
Alan Modra
2009-10-16 07:14:43 +00:00
parent 12edd763cc
commit 493152cb4f
4 changed files with 35 additions and 17 deletions

View File

@@ -709,7 +709,9 @@ bfd_close (bfd *abfd)
vector.
Until that's done, at least don't leak memory. */
struct bfd_in_memory *bim = (struct bfd_in_memory *) abfd->iostream;
free (bim->buffer);
if (bim->buffer != NULL)
free (bim->buffer);
free (bim);
ret = TRUE;
}