From 0a1a34b9b7f939d31d137f5cb80018979858fcc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 18 Oct 2014 10:59:48 +0200 Subject: [PATCH] Fixed Cppcheck warning, possible null pointer dereference of tok. --- lib/checkother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index a9089f999..733f000a8 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2242,7 +2242,7 @@ static bool isWithoutSideEffects(const Tokenizer *tokenizer, const Token* tok) while (tok && tok->astOperand2() && tok->astOperand2()->str() != "(") tok = tok->astOperand2(); - if (tok->varId()) { + if (tok && tok->varId()) { const Variable* var = tok->variable(); return var && (!var->isClass() || var->isPointer() || var->isStlType()); }