aboutsummaryrefslogtreecommitdiff
path: root/bfd/peicode.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/peicode.h')
-rw-r--r--bfd/peicode.h23
1 files changed, 19 insertions, 4 deletions
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,