Memory leaks: localized variables
This commit is contained in:
parent
62145431a7
commit
0cc49188c0
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue