Memory leak : Fixed a test where pointer is reassigned

This commit is contained in:
Daniel Marjamäki 2008-12-13 08:43:22 +00:00
parent 8ad2c58c56
commit 5ea8d411b5
1 changed files with 16 additions and 2 deletions

View File

@ -403,8 +403,22 @@ TOKEN *CheckMemoryLeakClass::getcode(const TOKEN *tok, std::list<const TOKEN *>
// assignment..
else
{
addtoken( "assign" );
{
// is the pointer in rhs?
bool rhs = false;
for ( const TOKEN *tok2 = tok->tokAt(2); tok2; tok2 = tok2->next() )
{
if ( tok2->str() == ";" )
break;
if ( tok2->str() == varname )
{
rhs = true;
break;
}
}
addtoken( rhs ? "use" : "assign" );
}
}