Use 'GenerateNode()' instead of 'GenerateSink()' when reporting a leak. A leak is not a hard enough bug to stop analyzing a path.

llvm-svn: 110471
This commit is contained in:
Ted Kremenek 2010-08-06 21:12:49 +00:00
parent ead526a056
commit b0c67c85db
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}
}
}
}