aboutsummaryrefslogtreecommitdiff
path: root/contrib/elftoolchain
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-02-04 21:15:29 +0000
committerMark Johnston <markj@FreeBSD.org>2020-02-04 21:15:29 +0000
commitab3b51df280b2d09f7c7b0d3c746535e296d1771 (patch)
tree1f114cbee2ae3187cf5f04db437de6f636ae6a83 /contrib/elftoolchain
parent513e76aaf8ccbb86513d73e53595e63e390f87e6 (diff)
downloadsrc-ab3b51df280b2d09f7c7b0d3c746535e296d1771.tar.gz
src-ab3b51df280b2d09f7c7b0d3c746535e296d1771.zip
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
Notes
Notes: svn path=/head/; revision=357534
Diffstat (limited to 'contrib/elftoolchain')
-rw-r--r--contrib/elftoolchain/libdwarf/libdwarf_frame.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/elftoolchain/libdwarf/libdwarf_frame.c b/contrib/elftoolchain/libdwarf/libdwarf_frame.c
index cfa69714b302..9c2a623b43d0 100644
--- a/contrib/elftoolchain/libdwarf/libdwarf_frame.c
+++ b/contrib/elftoolchain/libdwarf/libdwarf_frame.c
@@ -468,9 +468,9 @@ _dwarf_frame_section_init(Dwarf_Debug dbg, Dwarf_FrameSec *frame_sec,
if (length > ds->ds_size - offset ||
(length == 0 && !eh_frame)) {
- DWARF_SET_ERROR(dbg, error,
- DW_DLE_DEBUG_FRAME_LENGTH_BAD);
- return (DW_DLE_DEBUG_FRAME_LENGTH_BAD);
+ ret = DW_DLE_DEBUG_FRAME_LENGTH_BAD;
+ DWARF_SET_ERROR(dbg, error, ret);
+ goto fail_cleanup;
}
/* Check terminator for .eh_frame */