Fixed crash introduced by last commit.

This commit is contained in:
PKEuS 2015-01-22 10:51:06 +01:00
parent 7364cc8040
commit 7c60fe4aef
1 changed files with 1 additions and 1 deletions

View File

@ -1498,7 +1498,7 @@ bool CheckUninitVar::checkScopeForVariable(const Scope* scope, const Token *tok,
if (var.isPointer() && (var.typeStartToken()->isStandardType() || (var.type() && var.type()->needInitialization == Type::True)) && Token::Match(tok->next(), "= new")) {
if (alloc) {
*alloc = true;
if (var.typeScope()->numConstructors > 0)
if (var.typeScope() && var.typeScope()->numConstructors > 0)
return false;
}
continue;