2007-07-23 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 24 Jul 2007 19:58:06 +0000 (19:58 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 24 Jul 2007 19:58:06 +0000 (19:58 +0000)
* opncls.c (bfd_make_writable): Check return from bfd_malloc.

bfd/ChangeLog
bfd/opncls.c

index 1b377b4af87cebf0d881fe90e81eb3ab7d7f13cb..81221c3370c9c6e13a754680dacc89f8762a7c96 100644 (file)
@@ -1,5 +1,7 @@
 2007-07-24  Michael Snyder  <msnyder@access-company.com>
 
+       * 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.
 
index 01c8889b24dede1112f8df0359cf0eb08e69fe52..02066d8c1eca825c61bb066d648a05f72522cd4e 100644 (file)
@@ -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;