aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-08-13 03:10:52 +0000
committerTed Kremenek <kremenek@apple.com>2008-08-13 03:10:52 +0000
commit5c135b47d0fcdc33c912c4ed2ea750bdd6064da3 (patch)
treef4eed07f158baa4c758fb4527c9444527193bc4d
parentaf2f62ce32e462f256855cd24b06dec4755d2827 (diff)
Fix memory leak found by Sam Bishop: delete WList in the dstor of GRCoreEngineImpl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54714 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/GRCoreEngine.h2
-rw-r--r--lib/Analysis/GRCoreEngine.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/include/clang/Analysis/PathSensitive/GRCoreEngine.h
index 16f79856ba..013a315376 100644
--- a/include/clang/Analysis/PathSensitive/GRCoreEngine.h
+++ b/include/clang/Analysis/PathSensitive/GRCoreEngine.h
@@ -106,7 +106,7 @@ public:
/// steps. Returns true if there is still simulation state on the worklist.
bool ExecuteWorkList(unsigned Steps);
- virtual ~GRCoreEngineImpl() {}
+ virtual ~GRCoreEngineImpl();
CFG& getCFG() { return G->getCFG(); }
};
diff --git a/lib/Analysis/GRCoreEngine.cpp b/lib/Analysis/GRCoreEngine.cpp
index 548c4bf161..1c64c28c37 100644
--- a/lib/Analysis/GRCoreEngine.cpp
+++ b/lib/Analysis/GRCoreEngine.cpp
@@ -156,6 +156,9 @@ void GRCoreEngineImpl::HandleBlockEntrance(const BlockEntrance& L,
HandleBlockExit(L.getBlock(), Pred);
}
+GRCoreEngineImpl::~GRCoreEngineImpl() {
+ delete WList;
+}
void GRCoreEngineImpl::HandleBlockExit(CFGBlock * B, ExplodedNodeImpl* Pred) {