Memory leak: Fixed the test 'CheckMemoryLeak::func8'

This commit is contained in:
Daniel Marjamäki 2008-11-29 17:34:47 +00:00
parent 8c07a13cb6
commit f646684159
2 changed files with 16 additions and 1 deletions

View File

@ -499,6 +499,21 @@ TOKEN *CheckMemoryLeakClass::getcode(const TOKEN *tok, std::list<const TOKEN *>
addtoken( str );
}
// Callback..
if ( TOKEN::Match(tok, "( * %var% ) (") )
{
for ( const TOKEN *tok2 = tok->tokAt(5); tok2; tok2 = tok2->next )
{
if ( TOKEN::Match(tok2, ";{") )
break;
else if ( tok2->str() == varname )
{
addtoken("use");
break;
}
}
}
// Linux lists..
if ( TOKEN::Match( tok, "[=(,] & %var1% [.[]", varnames ) )
{

View File

@ -113,7 +113,7 @@ private:
TEST_CASE( func5 );
TEST_CASE( func6 );
// TODO TEST_CASE( func7 );
// TEST_CASE( func8 ); // Using callback
TEST_CASE( func8 ); // Using callback
// TODO TEST_CASE( class1 );
// TODO TEST_CASE( class2 );