summaryrefslogtreecommitdiffstats
path: root/tester/covoar/ExecutableInfo.cc
diff options
context:
space:
mode:
authorAlex White <alex.white@oarcorp.com>2021-02-25 10:56:11 -0600
committerJoel Sherrill <joel@rtems.org>2021-03-30 13:15:58 -0500
commitff418df159400eb4d21ae46faaa258083e7d77c8 (patch)
tree03db082764862814645d882033215ab7bfa2066c /tester/covoar/ExecutableInfo.cc
parentcoverage: Give coverage bars red background (diff)
downloadrtems-tools-ff418df159400eb4d21ae46faaa258083e7d77c8.tar.bz2
covoar: Fix null pointer dereference
A null pointer dereference happens later in the program execution if the files are cleaned up at the end of the ExecutableInfo constructor. This change fixes the null pointer dereference.
Diffstat (limited to 'tester/covoar/ExecutableInfo.cc')
-rw-r--r--tester/covoar/ExecutableInfo.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc
index 1e14721..2fcacf2 100644
--- a/tester/covoar/ExecutableInfo.cc
+++ b/tester/covoar/ExecutableInfo.cc
@@ -82,13 +82,16 @@ namespace Coverage {
throw;
}
- debug.end();
- executable.end();
- executable.close();
+ // Can't cleanup handles until the destructor because the information is
+ // referenced elsewhere. NOTE: This could cause problems from too many open
+ // file descriptors.
}
ExecutableInfo::~ExecutableInfo()
{
+ debug.end();
+ executable.end();
+ executable.close();
}
void ExecutableInfo::dumpCoverageMaps( void ) {