forked from Imagelibrary/binutils-gdb
* 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.
This commit is contained in:
@@ -1996,12 +1996,9 @@ mips_relax_section (abfd, sec, info, again)
|
||||
if (info->keep_memory)
|
||||
contents = (bfd_byte *) bfd_alloc (abfd, sec->_raw_size);
|
||||
else
|
||||
contents = (bfd_byte *) malloc ((size_t) sec->_raw_size);
|
||||
contents = (bfd_byte *) bfd_malloc ((size_t) sec->_raw_size);
|
||||
if (contents == (bfd_byte *) NULL)
|
||||
{
|
||||
bfd_set_error (bfd_error_no_memory);
|
||||
goto error_return;
|
||||
}
|
||||
goto error_return;
|
||||
if (! bfd_get_section_contents (abfd, sec, (PTR) contents,
|
||||
(file_ptr) 0, sec->_raw_size))
|
||||
goto error_return;
|
||||
|
||||
Reference in New Issue
Block a user