libdwarf: Fix a memory leak in _dwarf_frame_section_init().
If frame length validation failed we would leak memory. CID: 1193366 MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
513e76aaf8
commit
ab3b51df28
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=357534
@ -468,9 +468,9 @@ _dwarf_frame_section_init(Dwarf_Debug dbg, Dwarf_FrameSec *frame_sec,
|
|||||||
|
|
||||||
if (length > ds->ds_size - offset ||
|
if (length > ds->ds_size - offset ||
|
||||||
(length == 0 && !eh_frame)) {
|
(length == 0 && !eh_frame)) {
|
||||||
DWARF_SET_ERROR(dbg, error,
|
ret = DW_DLE_DEBUG_FRAME_LENGTH_BAD;
|
||||||
DW_DLE_DEBUG_FRAME_LENGTH_BAD);
|
DWARF_SET_ERROR(dbg, error, ret);
|
||||||
return (DW_DLE_DEBUG_FRAME_LENGTH_BAD);
|
goto fail_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check terminator for .eh_frame */
|
/* Check terminator for .eh_frame */
|
||||||
|
Loading…
Reference in New Issue
Block a user