diff --git a/lib/checkautovariables.cpp b/lib/checkautovariables.cpp index c8a0e2ab6..88cbd0ddc 100644 --- a/lib/checkautovariables.cpp +++ b/lib/checkautovariables.cpp @@ -270,7 +270,7 @@ void CheckAutoVariables::autoVariables() tok = Token::findmatch(tok->next(), "%var%"); if (isArrayVar(tok)) errorInvalidDeallocation(tok, nullptr); - else if (tok && tok->variable() && tok->variable()->isPointer()) { + else if (tok->variable() && tok->variable()->isPointer()) { for (const ValueFlow::Value &v : tok->values()) { if (!(v.isTokValue())) continue;