svn commit: r357532 - head/contrib/elftoolchain/libdwarf
Mark Johnston
markj at FreeBSD.org
Tue Feb 4 21:14:54 UTC 2020
Author: markj
Date: Tue Feb 4 21:14:53 2020
New Revision: 357532
URL: https://svnweb.freebsd.org/changeset/base/357532
Log:
libdwarf: Fix a possible memory leak in dwarf_add_AT_location_expr().
CID: 1193364
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Modified:
head/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c
Modified: head/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c
==============================================================================
--- head/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c Tue Feb 4 21:14:34 2020 (r357531)
+++ head/contrib/elftoolchain/libdwarf/dwarf_pro_attr.c Tue Feb 4 21:14:53 2020 (r357532)
@@ -46,8 +46,10 @@ dwarf_add_AT_location_expr(Dwarf_P_Debug dbg, Dwarf_P_
at->at_attrib = attr;
at->at_expr = loc_expr;
- if (_dwarf_expr_into_block(loc_expr, error) != DW_DLE_NONE)
+ if (_dwarf_expr_into_block(loc_expr, error) != DW_DLE_NONE) {
+ free(at);
return (DW_DLV_BADADDR);
+ }
at->u[0].u64 = loc_expr->pe_length;
at->u[1].u8p = loc_expr->pe_block;
if (loc_expr->pe_length <= UCHAR_MAX)
More information about the svn-src-head
mailing list