From 8600440e1479a8bd0394509b86a4d85d98ca6c8a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 19 Feb 2020 10:30:51 -0800 Subject: [PATCH] libbacktrace: don't free ELF strtab if error occurs after saving syminfo * elf.c (elf_add): Don't free strtab if an error occurs after recording symbol information. --- libbacktrace/ChangeLog | 5 +++++ libbacktrace/elf.c | 1 + 2 files changed, 6 insertions(+) diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index 6fa15fc4e96..13d907011d8 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,3 +1,8 @@ +2020-05-09 Ian Lance Taylor + + * elf.c (elf_add): Don't free strtab if an error occurs after + recording symbol information. + 2020-05-09 Ian Lance Taylor PR libbacktrace/88745 diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c index eb481c588e7..1216af86fd9 100644 --- a/libbacktrace/elf.c +++ b/libbacktrace/elf.c @@ -3011,6 +3011,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, string table permanently. */ backtrace_release_view (state, &symtab_view, error_callback, data); symtab_view_valid = 0; + strtab_view_valid = 0; *found_sym = 1; -- 2.30.2