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

@ -497,6 +497,21 @@ TOKEN *CheckMemoryLeakClass::getcode(const TOKEN *tok, std::list<const TOKEN *>
const char *str = call_func(tok, callstack, varnames, alloctype, dealloctype); const char *str = call_func(tok, callstack, varnames, alloctype, dealloctype);
if ( str ) if ( str )
addtoken( str ); 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.. // Linux lists..

View File

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