CheckMemoryLeakInFunction(getcode): don't call Token::Match() if varid equals to zero.
This commit is contained in:
parent
fe1101771a
commit
78d44e67ef
|
@ -627,8 +627,9 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
|
|||
if (parlevel == 0 && tok->str() == ";")
|
||||
addtoken(";");
|
||||
|
||||
if (Token::Match(tok->previous(), "[(;{}] %varid% =", varid) ||
|
||||
Token::Match(tok, "asprintf ( & %varid% ,", varid))
|
||||
if (varid &&
|
||||
(Token::Match(tok->previous(), "[(;{}] %varid% =", varid) ||
|
||||
Token::Match(tok, "asprintf ( & %varid% ,", varid)))
|
||||
{
|
||||
AllocType alloc;
|
||||
|
||||
|
|
Loading…
Reference in New Issue