readelf: Don't leak memory when dwarf_get_fde_info_for_all_regs() fails.
CID: 1292493 MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
37fa1df2d1
commit
85642eee46
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=357542
@ -5964,6 +5964,7 @@ dump_dwarf_frame_regtable(struct readelf *re, Dwarf_Fde fde, Dwarf_Addr pc,
|
|||||||
for (; cur_pc < end_pc; cur_pc++) {
|
for (; cur_pc < end_pc; cur_pc++) {
|
||||||
if (dwarf_get_fde_info_for_all_regs(fde, cur_pc, &rt, &row_pc,
|
if (dwarf_get_fde_info_for_all_regs(fde, cur_pc, &rt, &row_pc,
|
||||||
&de) != DW_DLV_OK) {
|
&de) != DW_DLV_OK) {
|
||||||
|
free(vec);
|
||||||
warnx("dwarf_get_fde_info_for_all_regs failed: %s\n",
|
warnx("dwarf_get_fde_info_for_all_regs failed: %s\n",
|
||||||
dwarf_errmsg(de));
|
dwarf_errmsg(de));
|
||||||
return (-1);
|
return (-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user