From 0dd008e068edaf71aa2854b1b3fb99cdb469eadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 8 Jul 2015 16:06:35 +0200 Subject: [PATCH] Fixed Cppcheck warning about possible null pointer dereference --- lib/checkother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index b6dbf6d28..367cc721f 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2638,7 +2638,7 @@ void CheckOther::checkVarFuncNullUB() if (f && f->argCount() <= argnr) { const Token *tok2 = f->argDef; tok2 = tok2 ? tok2->link() : nullptr; // goto ')' - if (Token::simpleMatch(tok2->tokAt(-3), ". . .")) + if (tok2 && Token::simpleMatch(tok2->tokAt(-3), ". . .")) varFuncNullUBError(tok); } }