CheckMemoryLeak: Made the checking weaker to reduce false positives

This commit is contained in:
Daniel Marjamäki 2008-05-10 08:33:22 +00:00
parent 7ae162792e
commit 9ce09909e6
1 changed files with 6 additions and 4 deletions

View File

@ -239,9 +239,9 @@ static void CheckMemoryLeak_CheckScope( const TOKEN *Tok1, const char varname[]
return; return;
// Linux lists.. todo: check if the first struct member is passed // Linux lists.. todo: check if the first struct member is passed
if ( Match( tok, "%var% ( & %var1% .", varnames ) ) if ( Match( tok, "%var% ( & %var1% .", varnames ) ||
Match( tok, ", & %var1% .", varnames ) )
{ {
if ( strstr(tok->str, "list_add") )
return; return;
} }
@ -530,6 +530,8 @@ static void CheckMemoryLeak_ClassMembers_Variable( const std::vector<const char
void CheckMemoryLeak() void CheckMemoryLeak()
{ {
listallocfunc.clear();
// Check for memory leaks inside functions.. // Check for memory leaks inside functions..
CheckMemoryLeak_InFunction(); CheckMemoryLeak_InFunction();