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:
Marcus Nilsson
2022-06-22 10:36:03 +02:00
committed by Jan Beulich
parent 46439c90f2
commit 4491a7c1aa
2 changed files with 6 additions and 1 deletions

View File

@@ -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);