Memory leak : Fixed a bug in getcode (assignment)
This commit is contained in:
parent
9a3696cb6f
commit
784fc0d33e
|
@ -421,12 +421,13 @@ TOKEN *CheckMemoryLeakClass::getcode(const TOKEN *tok, std::list<const TOKEN *>
|
||||||
{
|
{
|
||||||
// is the pointer in rhs?
|
// is the pointer in rhs?
|
||||||
bool rhs = false;
|
bool rhs = false;
|
||||||
for ( const TOKEN *tok2 = tok->tokAt(2); tok2; tok2 = tok2->next() )
|
std::string pattern("[=+] " + std::string(varname));
|
||||||
|
for ( const TOKEN *tok2 = tok; tok2; tok2 = tok2->next() )
|
||||||
{
|
{
|
||||||
if ( tok2->str() == ";" )
|
if ( tok2->str() == ";" )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ( tok2->str() == varname )
|
if ( TOKEN::Match(tok2, pattern.c_str()) )
|
||||||
{
|
{
|
||||||
rhs = true;
|
rhs = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue