Memory leaks: localized variables

This commit is contained in:
Daniel Marjamäki 2011-01-01 12:27:57 +01:00
parent 62145431a7
commit 0cc49188c0
1 changed files with 16 additions and 14 deletions

View File

@ -1526,6 +1526,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
void CheckMemoryLeakInFunction::simplifycode(Token *tok)
{
{
// Replace "throw" that is not in a try block with "return"
int indentlevel = 0;
int trylevel = -1;
@ -1544,6 +1545,7 @@ void CheckMemoryLeakInFunction::simplifycode(Token *tok)
else if (trylevel == -1 && tok2->str() == "throw")
tok2->str("return");
}
}
// Insert extra ";"
for (Token *tok2 = tok; tok2; tok2 = tok2->next())