CheckMemoryLeak: A few tweaks to make it report less false positives against the linux kernel
This commit is contained in:
parent
7708c2c1d1
commit
70a9fa246c
|
@ -14,9 +14,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern bool ShowAll;
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -207,9 +204,17 @@ static void CheckMemoryLeak_CheckScope( const TOKEN *Tok1, const char varname[]
|
||||||
// foo( var1 );
|
// foo( var1 );
|
||||||
if ( Match( tok, "[=,(] %var1% [,);]", varnames ) )
|
if ( Match( tok, "[=,(] %var1% [,);]", varnames ) )
|
||||||
return;
|
return;
|
||||||
if ( Match( tok, "= ( %type% * ) %var1% ;", varnames ) )
|
if ( Match( tok, "[=,(] ( %type% * ) %var1% [,);]", varnames ) )
|
||||||
|
return;
|
||||||
|
if ( Match( tok, "[=,(] ( %type% %type% * ) %var1% [,);]", varnames ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Linux lists..
|
||||||
|
if ( Match( tok, "%var% ( & %var1% .", varnames ) )
|
||||||
|
{
|
||||||
|
if ( strstr(tok->str, "list_add") )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// continue/break loop..
|
// continue/break loop..
|
||||||
if (Alloc != No &&
|
if (Alloc != No &&
|
||||||
|
|
Loading…
Reference in New Issue