Fixed CID 1037088 Dereference after null check in Tokenizer::simplifyLabelsCaseDefault.

This commit is contained in:
orbitcowboy 2014-05-23 21:38:56 +02:00
parent 7920afdc60
commit 6183f21070
1 changed files with 1 additions and 1 deletions

View File

@ -2211,7 +2211,7 @@ void Tokenizer::simplifyLabelsCaseDefault()
if (Token::Match(tok->next(),"[:{};]")) if (Token::Match(tok->next(),"[:{};]"))
break; break;
} }
if (tok->str() != "case" && tok->next()->str() == ":") { if (tok->str() != "case" && tok->next() && tok->next()->str() == ":") {
tok = tok->next(); tok = tok->next();
if (tok->next()->str() != ";") if (tok->next()->str() != ";")
tok->insertToken(";"); tok->insertToken(";");