forked from Imagelibrary/binutils-gdb
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user