summaryrefslogtreecommitdiff
path: root/libbacktrace/pecoff.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2018-01-25 15:38:41 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-01-25 15:38:41 +0000
commita794e494c6e3b1c0d63158e414beaa52ded2eac1 (patch)
treee7cb5f102afc8aa2a0040875900e6610387d9605 /libbacktrace/pecoff.c
parent45f3ab193dfa5c49ab7b61a7ade2eb5e476641d0 (diff)
downloadgcc-a794e494c6e3b1c0d63158e414beaa52ded2eac1.tar.gz
* pecoff.c (coff_add): Only release syms_view if it is valid.
From-SVN: r257053
Diffstat (limited to 'libbacktrace/pecoff.c')
-rw-r--r--libbacktrace/pecoff.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libbacktrace/pecoff.c b/libbacktrace/pecoff.c
index 015887731a0..85737d61d49 100644
--- a/libbacktrace/pecoff.c
+++ b/libbacktrace/pecoff.c
@@ -804,8 +804,11 @@ coff_add (struct backtrace_state *state, int descriptor,
backtrace_release_view (state, &sects_view, error_callback, data);
sects_view_valid = 0;
- backtrace_release_view (state, &syms_view, error_callback, data);
- syms_view_valid = 0;
+ if (syms_view_valid)
+ {
+ backtrace_release_view (state, &syms_view, error_callback, data);
+ syms_view_valid = 0;
+ }
/* Read all the debug sections in a single view, since they are
probably adjacent in the file. We never release this view. */