From 58142f101dd3256f4741f60a6b25672d79b91371 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 1 Dec 1995 19:48:10 +0000 Subject: * libbfd.c (bfd_malloc, bfd_realloc): New functions. (bfd_zmalloc): Return PTR, not char *. Take size_t, not bfd_size_type. * libbfd-in.h (bfd_malloc, bfd_realloc): Declare. (bfd_zmalloc): Change declaration. * libbfd.h: Rebuild. * Many files: Use bfd_malloc and bfd_realloc rather than malloc and realloc. Don't set bfd_error_no_memory if they fail. --- bfd/srec.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'bfd/srec.c') 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; } -- cgit v1.1