summaryrefslogtreecommitdiffstats
path: root/src/addr2line.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2015-05-21 16:05:18 +0200
committerMark Wielaard <[email protected]>2015-05-27 17:17:51 +0200
commit6f2e64a03bdf10d5b0ab730e58aedb8dfb76b6d8 (patch)
treeebae8912d927848997d51f411c3c83c1f27c802c /src/addr2line.c
parentb23a5b2dda2a0beaaa12c8174808b5d0bd5996ea (diff)
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 <[email protected]>
Diffstat (limited to 'src/addr2line.c')
-rw-r--r--src/addr2line.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/addr2line.c b/src/addr2line.c
index fc2ff284..97f988ff 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)