Memory leak: Minor fix to prevent hang
This commit is contained in:
parent
745d885808
commit
d6075a2125
|
@ -177,9 +177,15 @@ const char * CheckMemoryLeakClass::call_func( const TOKEN *tok, std::list<const
|
||||||
if (GetAllocationType(tok)!=No || GetDeallocationType(tok,varnames)!=No)
|
if (GetAllocationType(tok)!=No || GetDeallocationType(tok,varnames)!=No)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if ( callstack.size() > 10 )
|
||||||
|
return 0;
|
||||||
|
|
||||||
const char *funcname = tok->str;
|
const char *funcname = tok->str;
|
||||||
if ( std::find(callstack.begin(), callstack.end(), tok) != callstack.end() )
|
for ( std::list<const TOKEN *>::const_iterator it = callstack.begin(); it != callstack.end(); ++it )
|
||||||
return "use";
|
{
|
||||||
|
if ( std::string(funcname) == (*it)->str )
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
callstack.push_back(tok);
|
callstack.push_back(tok);
|
||||||
|
|
||||||
int par = 1;
|
int par = 1;
|
||||||
|
|
Loading…
Reference in New Issue