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,10 +239,10 @@ static void CheckMemoryLeak_CheckScope( const TOKEN *Tok1, const char varname[]
return;
// 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;
}
// continue/break loop..
@ -529,7 +529,9 @@ static void CheckMemoryLeak_ClassMembers_Variable( const std::vector<const char
//---------------------------------------------------------------------------
void CheckMemoryLeak()
{
{
listallocfunc.clear();
// Check for memory leaks inside functions..
CheckMemoryLeak_InFunction();