readelf: Fix the check for an error from realloc().
Use err() instead of errx() while here, since realloc() sets errno. CID: 1401326 MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
6194ecf3bc
commit
6e491b7592
@ -6298,8 +6298,8 @@ search_loclist_at(struct readelf *re, Dwarf_Die die, Dwarf_Unsigned lowpc,
|
||||
if (*la_list_cap == *la_list_len) {
|
||||
*la_list = realloc(*la_list,
|
||||
*la_list_cap * 2 * sizeof(**la_list));
|
||||
if (la_list == NULL)
|
||||
errx(EXIT_FAILURE, "realloc failed");
|
||||
if (*la_list == NULL)
|
||||
err(EXIT_FAILURE, "realloc failed");
|
||||
*la_list_cap *= 2;
|
||||
}
|
||||
la = &((*la_list)[*la_list_len]);
|
||||
|
Loading…
Reference in New Issue
Block a user