From a794e494c6e3b1c0d63158e414beaa52ded2eac1 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 25 Jan 2018 15:38:41 +0000 Subject: [PATCH] * pecoff.c (coff_add): Only release syms_view if it is valid. From-SVN: r257053 --- libbacktrace/ChangeLog | 4 ++++ libbacktrace/pecoff.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index ddad6f0ec2f..ef9fa2eb54e 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,3 +1,7 @@ +2018-01-25 Ian Lance Taylor + + * pecoff.c (coff_add): Only release syms_view if it is valid. + 2018-01-25 Ian Lance Taylor * pecoff.c (coff_add): Another memcpy -> coff_read4 fix. 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, §s_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. */ -- 2.30.2