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.
This commit is contained in:
Ian Lance Taylor
2020-02-19 10:30:51 -08:00
parent dea40c941a
commit 8600440e14
2 changed files with 6 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
2020-05-09 Ian Lance Taylor <iant@golang.org>
* elf.c (elf_add): Don't free strtab if an error occurs after
recording symbol information.
2020-05-09 Ian Lance Taylor <iant@golang.org>
PR libbacktrace/88745

View File

@@ -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;