mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-17 13:10:12 +08:00
readelf: replace xmalloc with malloc in slurp_relr_relocs
Using xmalloc makes the null check redundant since failing allocation will exit the program. Instead use malloc and let the error be conveyed up the call chain.
This commit is contained in:
parent
46439c90f2
commit
4491a7c1aa
@ -1,3 +1,8 @@
|
||||
2022-06-22 Marcus Nilsson <brainbomb@gmail.com>
|
||||
|
||||
* readelf.c: (slurp_relr_relocs) Use malloc instead of xmalloc
|
||||
when allocating space for relocations.
|
||||
|
||||
2022-06-21 Kumar N, Bhuvanendra via Binutils <Kavitha.Natarajan@amd.com>
|
||||
|
||||
* dwarf.h (struct debug_info): Add rnglists_base field.
|
||||
|
@ -1401,7 +1401,7 @@ slurp_relr_relocs (Filedata * filedata,
|
||||
size++;
|
||||
}
|
||||
|
||||
*relrsp = (bfd_vma *) xmalloc (size * sizeof (bfd_vma));
|
||||
*relrsp = (bfd_vma *) malloc (size * sizeof (bfd_vma));
|
||||
if (*relrsp == NULL)
|
||||
{
|
||||
free (relrs);
|
||||
|
Loading…
Reference in New Issue
Block a user