Fixed crash in checkmemoryleak.cpp reported by HeisSpiter

This commit is contained in:
PKEuS 2012-03-17 11:34:27 +01:00
parent fb4709f1be
commit 60cc8296c3
1 changed files with 1 additions and 1 deletions

View File

@ -2439,7 +2439,7 @@ void CheckMemoryLeakInClass::variable(const Scope *scope, const Token *tokVarnam
const bool destructor = func->type == Function::eDestructor; const bool destructor = func->type == Function::eDestructor;
bool body = false; bool body = false;
bool initlist = func->token->linkAt(1)->strAt(1) == ":"; bool initlist = func->token->linkAt(1)->strAt(1) == ":";
const Token *end = func->start->link(); const Token *end = func->start?func->start->link():0;
for (const Token *tok = func->token; tok != end; tok = tok->next()) { for (const Token *tok = func->token; tok != end; tok = tok->next()) {
if (tok == func->start) if (tok == func->start)
body = true; body = true;