Check "var" for null pointer before using it
Reported by covertey -> amai on IRC.
This commit is contained in:
parent
c0aceb893e
commit
a83fe0e268
|
@ -1127,7 +1127,7 @@ void CheckUnusedVar::checkFunctionVariableUsage()
|
||||||
unreadVariableError(usage._lastAccess, varname);
|
unreadVariableError(usage._lastAccess, varname);
|
||||||
|
|
||||||
// variable has been read but not written
|
// variable has been read but not written
|
||||||
else if (!usage._write && !usage._allocateMemory && !var->isStlType() && var && !isEmptyType(var->type()))
|
else if (!usage._write && !usage._allocateMemory && var && !var->isStlType() && !isEmptyType(var->type()))
|
||||||
unassignedVariableError(usage._var->nameToken(), varname);
|
unassignedVariableError(usage._var->nameToken(), varname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue