Fixed Cppcheck warning about possible null pointer dereference
This commit is contained in:
parent
23402b9b44
commit
5a9328f26a
|
@ -311,7 +311,7 @@ void CheckOther::clarifyStatement()
|
|||
while (tok2 && tok2->str() == "*")
|
||||
tok2 = tok2->previous();
|
||||
|
||||
if (!tok2->astParent() && Token::Match(tok2, "[{};]")) {
|
||||
if (tok2 && !tok2->astParent() && Token::Match(tok2, "[{};]")) {
|
||||
tok2 = tok->astOperand1();
|
||||
if (Token::Match(tok2, "++|-- [;,]"))
|
||||
clarifyStatementError(tok2);
|
||||
|
|
Loading…
Reference in New Issue