From: Mark Wielaard Date: Thu, 21 May 2015 14:05:18 +0000 (+0200) Subject: addr2line: Set scopes to NULL after free in handle_address. X-Git-Tag: elfutils-0.162~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f2e64a03bdf10d5b0ab730e58aedb8dfb76b6d8;p=thirdparty%2Felfutils.git addr2line: Set scopes to NULL after free in handle_address. If dwarf_getscopes_die () fails then scopes might not be reset and we could cause a double free. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index c93d54d14..ee1800764 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2015-05-21 Mark Wielaard + + * addr2line.c (handle_address): Set scopes to NULL after free. + 2015-05-20 Mark Wielaard * addr2line.c (OPT_PRETTY): New constant define. diff --git a/src/addr2line.c b/src/addr2line.c index fc2ff284f..97f988ff7 100644 --- a/src/addr2line.c +++ b/src/addr2line.c @@ -744,6 +744,7 @@ handle_address (const char *string, Dwfl *dwfl) dwarf_offdie (dwfl_module_getdwarf (mod, &bias), dieoff, &subroutine); free (scopes); + scopes = NULL; nscopes = dwarf_getscopes_die (&subroutine, &scopes); if (nscopes > 1)