Fixed Cppcheck warnings about null pointer dereference

This commit is contained in:
Daniel Marjamäki 2017-05-15 20:35:57 +02:00
parent 8d75d1b920
commit 3ef2f825c7
1 changed files with 5 additions and 0 deletions

View File

@ -465,6 +465,11 @@ void CheckNullPointer::nullPointerError(const Token *tok, const std::string &var
return;
}
if (!value) {
reportError(tok, Severity::error, "nullPointer", "Null pointer dereference", CWE476, inconclusive);
return;
}
if (!_settings->isEnabled(value, inconclusive))
return;