Fixed crash introduced by last commit.
This commit is contained in:
parent
7364cc8040
commit
7c60fe4aef
|
@ -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 (var.isPointer() && (var.typeStartToken()->isStandardType() || (var.type() && var.type()->needInitialization == Type::True)) && Token::Match(tok->next(), "= new")) {
|
||||||
if (alloc) {
|
if (alloc) {
|
||||||
*alloc = true;
|
*alloc = true;
|
||||||
if (var.typeScope()->numConstructors > 0)
|
if (var.typeScope() && var.typeScope()->numConstructors > 0)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue