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
dfa169049b
commit
37fa1df2d1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=357541
@ -6298,8 +6298,8 @@ search_loclist_at(struct readelf *re, Dwarf_Die die, Dwarf_Unsigned lowpc,
|
|||||||
if (*la_list_cap == *la_list_len) {
|
if (*la_list_cap == *la_list_len) {
|
||||||
*la_list = realloc(*la_list,
|
*la_list = realloc(*la_list,
|
||||||
*la_list_cap * 2 * sizeof(**la_list));
|
*la_list_cap * 2 * sizeof(**la_list));
|
||||||
if (la_list == NULL)
|
if (*la_list == NULL)
|
||||||
errx(EXIT_FAILURE, "realloc failed");
|
err(EXIT_FAILURE, "realloc failed");
|
||||||
*la_list_cap *= 2;
|
*la_list_cap *= 2;
|
||||||
}
|
}
|
||||||
la = &((*la_list)[*la_list_len]);
|
la = &((*la_list)[*la_list_len]);
|
||||||
|
Loading…
Reference in New Issue
Block a user