CheckClass: Fixed nullpointer check and then dereference warning.

This commit is contained in:
Daniel Marjamäki 2013-05-17 14:10:53 +02:00
parent 650027a07a
commit 1476787f40
1 changed files with 5 additions and 2 deletions

View File

@ -899,8 +899,11 @@ void CheckClass::noMemset()
const Token* arg1 = tok->tokAt(2); const Token* arg1 = tok->tokAt(2);
const Token* arg3 = arg1; const Token* arg3 = arg1;
arg3 = arg3->nextArgument(); arg3 = arg3->nextArgument();
if (arg3) arg3 = (arg3 != NULL) ? arg3->nextArgument() : NULL;
arg3 = arg3->nextArgument(); if (!arg3)
// weird, shouldn't happen: memset etc should have
// 3 arguments.
continue;
const Token *typeTok = 0; const Token *typeTok = 0;
const Scope *type = 0; const Scope *type = 0;