From 773ee8c32aaf627d6952bda2a8569365696f6ce8 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Fri, 11 Sep 2015 17:26:33 +0300 Subject: [PATCH] Better variable name, explicit no-op --- lib/checkmemoryleak.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index f302c03ac..4c8bf37ae 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -1198,7 +1198,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list f; + std::stack functions; for (const Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) { if (tok2->str() == ";") { @@ -1207,17 +1207,18 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::liststr() == "(") - f.push(tok2->previous()); - else if (!f.empty() && tok2->str() == ")") - f.pop(); + functions.push(tok2->previous()); + else if (!functions.empty() && tok2->str() == ")") + functions.pop(); if (tok2->varId() == varid) { // Read data.. if (!Token::Match(tok2->previous(), "&|(") && tok2->strAt(1) == "[") { - } else if (f.empty() || - !test_white_list(f.top()->str(), _settings, tokenizer->isCPP()) || - getDeallocationType(f.top(),varid)) { + ; + } else if (functions.empty() || + !test_white_list(functions.top()->str(), _settings, tokenizer->isCPP()) || + getDeallocationType(functions.top(),varid)) { use = true; } }