Only check pointer that can be null at that point
This commit is contained in:
parent
288ee96cc7
commit
e4de220a2d
|
@ -155,10 +155,10 @@ void CheckSizeof::checkSizeofForPointerSize()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tokFunc && tokFunc->str() == "calloc")
|
if (tokSize && tokFunc->str() == "calloc")
|
||||||
tokSize = tokSize->nextArgument();
|
tokSize = tokSize->nextArgument();
|
||||||
|
|
||||||
if (tokFunc && tokSize) {
|
if (tokSize) {
|
||||||
const Token * const paramsListEndTok = tokFunc->linkAt(1);
|
const Token * const paramsListEndTok = tokFunc->linkAt(1);
|
||||||
for (const Token* tok2 = tokSize; tok2 != paramsListEndTok; tok2 = tok2->next()) {
|
for (const Token* tok2 = tokSize; tok2 != paramsListEndTok; tok2 = tok2->next()) {
|
||||||
if (Token::simpleMatch(tok2, "/ sizeof")) {
|
if (Token::simpleMatch(tok2, "/ sizeof")) {
|
||||||
|
|
Loading…
Reference in New Issue