Memory leak : Fixed a test where pointer is reassigned
This commit is contained in:
parent
8ad2c58c56
commit
5ea8d411b5
|
@ -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" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue