From: Michael Snyder Date: Tue, 24 Jul 2007 19:58:06 +0000 (+0000) Subject: 2007-07-23 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6eea5aed8e0b3c097bbeaf9180ff6898ef9389c;p=binutils-gdb.git 2007-07-23 Michael Snyder * opncls.c (bfd_make_writable): Check return from bfd_malloc. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1b377b4af87..81221c3370c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,7 @@ 2007-07-24 Michael Snyder + * opncls.c (bfd_make_writable): Check return from bfd_malloc. + * elflink.c (bfd_elf_final_link): Avoid redundant frees -- return on bfd_malloc error rather than goto error_return. diff --git a/bfd/opncls.c b/bfd/opncls.c index 01c8889b24d..02066d8c1ec 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -799,6 +799,8 @@ bfd_make_writable (bfd *abfd) } bim = bfd_malloc (sizeof (struct bfd_in_memory)); + if (bim == NULL) + return FALSE; /* bfd_error already set. */ abfd->iostream = bim; /* bfd_bwrite will grow these as needed. */ bim->size = 0;