aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-11-29 22:10:57 +0000
committerIan Lance Taylor <ian@airs.com>1995-11-29 22:10:57 +0000
commitb00c57ec37e4c971d96b40cf76ce21f8837b84a5 (patch)
tree09918862516fee9448cf3960ff0c664df7b83d9c
parenta9713b91a74c2cc05db65ec58573f388d2c41cc0 (diff)
downloadgdb-b00c57ec37e4c971d96b40cf76ce21f8837b84a5.zip
gdb-b00c57ec37e4c971d96b40cf76ce21f8837b84a5.tar.gz
gdb-b00c57ec37e4c971d96b40cf76ce21f8837b84a5.tar.bz2
* peicode.h (pe_print_idata): Call malloc rather than xmalloc.
(pe_print_pdata): Likewise.
-rw-r--r--bfd/ChangeLog3
-rw-r--r--bfd/peicode.h23
2 files changed, 22 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c572746..23b0ca7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/peicode.h b/bfd/peicode.h
index 98db722..79c427e 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -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,