memory leaks: fixed false positive for struct members - better handling of if/else

This commit is contained in:
Daniel Marjamäki 2009-07-24 09:05:40 +02:00
parent 73c028bdb7
commit 6bb85703f6
2 changed files with 2 additions and 2 deletions

View File

@ -2029,7 +2029,7 @@ void CheckMemoryLeakStructMember::check()
}
// Deallocating the struct..
else if (Token::Match(tok3, "free|kfree ( %varid% )", structid))
else if (indentlevel2 == 0 && Token::Match(tok3, "free|kfree ( %varid% )", structid))
{
memoryLeak(tok3, (vartok->str() + "." + tok2->strAt(2)).c_str(), Malloc, false);
break;

View File

@ -2995,7 +2995,7 @@ private:
" free(abc->a);\n"
" free(abc);\n"
"}\n");
TODO_ASSERT_EQUALS("", errout.str());
ASSERT_EQUALS("", errout.str());
}
};