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