diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 75f5256b6..1d472658c 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -2027,7 +2027,7 @@ const Token *CheckMemoryLeakInFunction::findleak(const Token *tokens) // Check for memory leaks for a function variable. -void CheckMemoryLeakInFunction::checkScope(const Token *Tok1, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz) +void CheckMemoryLeakInFunction::checkScope(const Token *startTok, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz) { std::list callstack; @@ -2036,7 +2036,7 @@ void CheckMemoryLeakInFunction::checkScope(const Token *Tok1, const std::string const Token *result; - Token *tok = getcode(Tok1, callstack, varid, alloctype, dealloctype, classmember, sz); + Token *tok = getcode(startTok, callstack, varid, alloctype, dealloctype, classmember, sz); //tok->printOut((std::string("Checkmemoryleak: getcode result for: ") + varname).c_str()); const bool use_addr = bool(Token::findsimplematch(tok, "&use") != nullptr); diff --git a/lib/checkmemoryleak.h b/lib/checkmemoryleak.h index d75d1c14a..ab7433b16 100644 --- a/lib/checkmemoryleak.h +++ b/lib/checkmemoryleak.h @@ -288,13 +288,13 @@ public: /** * Checking the variable varname - * @param Tok1 start token + * @param startTok start token * @param varname name of variable (for error messages) * @param varid variable id * @param classmember is the scope inside a class member function * @param sz size of type.. if the variable is a "int *" then sz should be "sizeof(int)" */ - void checkScope(const Token *Tok1, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz); + void checkScope(const Token *startTok, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz); private: /** Report all possible errors (for the --errorlist) */