diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-08-06 21:12:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-08-06 21:12:49 +0000 |
commit | cea68654a4e7c44e12364ed3c98b8340f682b599 (patch) | |
tree | a4462fe5d30802fe7e944f3489549791ec9a8e36 /lib/Checker/MallocChecker.cpp | |
parent | 16fd39fb11cce33d58ecdd39f25540b85c1542b4 (diff) |
Use 'GenerateNode()' instead of 'GenerateSink()' when reporting a leak. A leak is not a hard enough bug to stop analyzing a path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110471 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/MallocChecker.cpp')
-rw-r--r-- | lib/Checker/MallocChecker.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Checker/MallocChecker.cpp b/lib/Checker/MallocChecker.cpp index f6125636f2..5ad1706e05 100644 --- a/lib/Checker/MallocChecker.cpp +++ b/lib/Checker/MallocChecker.cpp @@ -650,9 +650,8 @@ void MallocChecker::VisitLocation(CheckerContext &C, const Stmt *S, SVal l) { SymbolRef Sym = l.getLocSymbolInBase(); if (Sym) { const RefState *RS = C.getState()->get<RegionState>(Sym); - if (RS) - if (RS->isReleased()) { - ExplodedNode *N = C.GenerateSink(); + if (RS && RS->isReleased()) { + if (ExplodedNode *N = C.GenerateNode()) { if (!BT_UseFree) BT_UseFree = new BuiltinBug("Use dynamically allocated memory after" " it is freed."); @@ -661,6 +660,7 @@ void MallocChecker::VisitLocation(CheckerContext &C, const Stmt *S, SVal l) { N); C.EmitReport(R); } + } } } |