From c5e14ad590bb57b88b58a007a00f9441b6a3dc66 Mon Sep 17 00:00:00 2001 From: jrp2014 Date: Thu, 5 Apr 2018 21:41:31 +0200 Subject: [PATCH] Refactor lib/checkmemoryleak.cpp --- lib/checkmemoryleak.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index ff18ace6c..7ffc433d9 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -2251,8 +2251,7 @@ void CheckMemoryLeakInClass::check() const std::size_t classes = symbolDatabase->classAndStructScopes.size(); for (std::size_t i = 0; i < classes; ++i) { const Scope * scope = symbolDatabase->classAndStructScopes[i]; - std::list::const_iterator var; - for (var = scope->varlist.begin(); var != scope->varlist.end(); ++var) { + for (std::list::const_iterator var = scope->varlist.begin(); var != scope->varlist.end(); ++var) { if (!var->isStatic() && var->isPointer()) { // allocation but no deallocation of private variables in public function.. const Token *tok = var->typeStartToken();