Permalink
Browse files

fixed cppcheck inconclusive warning, possible null pointer dereferenc…

…e otherwise condition is redundant
  • Loading branch information...
1 parent ca5e974 commit 4511d0fe5f583342bf04498d9b2d49a9ed934b29 @danmar committed Feb 11, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/executionpath.cpp
View
@@ -402,6 +402,11 @@ void ExecutionPath::checkScope(const Token *tok, std::list<ExecutionPath *> &che
if (tok && tok->str() == "if")
continue;
+ if (!tok) {
+ ExecutionPath::bailOut(newchecks);
+ return;
+ }
+
// there is no "if"..
ExecutionPath::checkScope(tok->next(), checks);
tok = tok->link();

0 comments on commit 4511d0f

Please sign in to comment.