From 95db173e77767eb79645b842ebe3a088ac4f5414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 13 May 2017 11:06:33 +0200 Subject: [PATCH] Fixed Cppcheck warning --- lib/checkuninitvar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index 5b2a363ef..cd9e0a1fe 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -1033,12 +1033,14 @@ int CheckUninitVar::isFunctionParUsage(const Token *vartok, bool pointer, Alloc ++argumentNumber; start = start->previous(); } + if (!start) + return -1; if (Token::simpleMatch(start->link(), ") {")) return (!pointer || alloc == NO_ALLOC); // is this a function call? - if (start && Token::Match(start->previous(), "%name% (")) { + if (Token::Match(start->previous(), "%name% (")) { const bool address(vartok->previous()->str() == "&"); const bool array(vartok->variable() && vartok->variable()->isArray()); // check how function handle uninitialized data arguments..