aboutsummaryrefslogtreecommitdiff
path: root/bfd/srec.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/srec.c')
-rw-r--r--bfd/srec.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/bfd/srec.c b/bfd/srec.c
index 4b8fa4b..466a85b 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -461,12 +461,9 @@ srec_scan (abfd)
{
if (buf != NULL)
free (buf);
- buf = (bfd_byte *) malloc (bytes * 2);
+ buf = (bfd_byte *) bfd_malloc (bytes * 2);
if (buf == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- goto error_return;
- }
+ goto error_return;
bufsize = bytes * 2;
}
@@ -667,12 +664,9 @@ srec_read_section (abfd, section, contents)
{
if (buf != NULL)
free (buf);
- buf = (bfd_byte *) malloc (bytes * 2);
+ buf = (bfd_byte *) bfd_malloc (bytes * 2);
if (buf == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- goto error_return;
- }
+ goto error_return;
bufsize = bytes * 2;
}