diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/addr2line.c | 15 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 35c68c78..15e6faea 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2015-06-09 Mark Wielaard <[email protected]> + * addr2line.c (print_dwarf_function): Always free scopes before + returning. + +2015-06-09 Mark Wielaard <[email protected]> + * strip.c (handle_ar): Mark as unused. (process_file): Produce an error when trying to handle an ar. diff --git a/src/addr2line.c b/src/addr2line.c index 97f988ff..0ce854f6 100644 --- a/src/addr2line.c +++ b/src/addr2line.c @@ -330,6 +330,7 @@ print_dwarf_function (Dwfl_Module *mod, Dwarf_Addr addr) if (nscopes <= 0) return false; + bool res = false; for (int i = 0; i < nscopes; ++i) switch (dwarf_tag (&scopes[i])) { @@ -337,23 +338,25 @@ print_dwarf_function (Dwfl_Module *mod, Dwarf_Addr addr) { const char *name = get_diename (&scopes[i]); if (name == NULL) - return false; + goto done; printf ("%s%c", symname (name), pretty ? ' ' : '\n'); - return true; + res = true; + goto done; } case DW_TAG_inlined_subroutine: { const char *name = get_diename (&scopes[i]); if (name == NULL) - return false; + goto done; /* When using --pretty-print we only show inlines on their own line. Just print the first subroutine name. */ if (pretty) { printf ("%s ", symname (name)); - return true; + res = true; + goto done; } else printf ("%s inlined", symname (name)); @@ -414,7 +417,9 @@ print_dwarf_function (Dwfl_Module *mod, Dwarf_Addr addr) } } - return false; +done: + free (scopes); + return res; } static void |
