optimisation: made the memory leaks checking faster

This commit is contained in:
Daniel Marjamäki 2009-10-08 20:49:27 +02:00
parent aa008ebd3e
commit b95f0eaa41
1 changed files with 7 additions and 0 deletions

View File

@ -1815,6 +1815,13 @@ void CheckMemoryLeakInFunction::checkScope(const Token *Tok1, const std::string
}
}
// If the variable is not allocated at all => no memory leak
if (Token::findmatch(tok, "alloc") == 0)
{
Tokenizer::deleteTokens(tok);
return;
}
simplifycode(tok, all);
if (_settings->_debug && _settings->_verbose)