* peicode.h (pe_print_idata): Call malloc rather than xmalloc.
authorIan Lance Taylor <ian@airs.com>
Wed, 29 Nov 1995 22:10:57 +0000 (22:10 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 29 Nov 1995 22:10:57 +0000 (22:10 +0000)
(pe_print_pdata): Likewise.

bfd/ChangeLog
bfd/peicode.h

index c572746db1d80f41b4c18f38da706091c30ce4b3..23b0ca7657bcb1f1a6d5ced0d1ac54c165713b09 100644 (file)
@@ -1,5 +1,8 @@
 Wed Nov 29 12:42:36 1995  Ian Lance Taylor  <ian@cygnus.com>
 
+       * peicode.h (pe_print_idata): Call malloc rather than xmalloc.
+       (pe_print_pdata): Likewise.
+
        * opncls.c (bfd_alloc_by_size_t): Set bfd_error_no_memory if
        obstack_alloc fails.
        (bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish
index 98db7226a97742d4f9907c4a45b7d522f9f596ab..79c427eceb8d0db58eec8d65854b1e2bf45c0279 100644 (file)
@@ -1160,8 +1160,13 @@ pe_print_idata(abfd, vfile)
 
       bfd_byte *data = 0;
       int offset;
-      data = (bfd_byte *) xmalloc ((size_t) bfd_section_size (abfd, 
-                                                             rel_section));
+      data = (bfd_byte *) malloc ((size_t) bfd_section_size (abfd, 
+                                                            rel_section));
+      if (data == NULL && bfd_section_size (abfd, rel_section) != 0)
+       {
+         bfd_set_error (bfd_error_no_memory);
+         return false;
+       }
       datasize = bfd_section_size (abfd, rel_section);
   
       bfd_get_section_contents (abfd, 
@@ -1199,8 +1204,13 @@ pe_print_idata(abfd, vfile)
   if (bfd_section_size (abfd, section) == 0)
     return true;
 
-  data = (bfd_byte *) xmalloc ((size_t) bfd_section_size (abfd, section));
+  data = (bfd_byte *) malloc ((size_t) bfd_section_size (abfd, section));
   datasize = bfd_section_size (abfd, section);
+  if (data == NULL && datasize != 0)
+    {
+      bfd_set_error (bfd_error_no_memory);
+      return false;
+    }
 
   bfd_get_section_contents (abfd, 
                            section, 
@@ -1353,8 +1363,13 @@ pe_print_pdata(abfd, vfile)
   if (bfd_section_size (abfd, section) == 0)
     return true;
 
-  data = (bfd_byte *) xmalloc ((size_t) bfd_section_size (abfd, section));
+  data = (bfd_byte *) malloc ((size_t) bfd_section_size (abfd, section));
   datasize = bfd_section_size (abfd, section);
+  if (data == NULL && datasize != 0)
+    {
+      bfd_set_error (bfd_error_no_memory);
+      return false;
+    }
 
   bfd_get_section_contents (abfd, 
                            section,