Fixed Cppcheck warnings about null pointer dereference
This commit is contained in:
parent
8d75d1b920
commit
3ef2f825c7
|
@ -465,6 +465,11 @@ void CheckNullPointer::nullPointerError(const Token *tok, const std::string &var
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
reportError(tok, Severity::error, "nullPointer", "Null pointer dereference", CWE476, inconclusive);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!_settings->isEnabled(value, inconclusive))
|
if (!_settings->isEnabled(value, inconclusive))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue