Memory leaks: calling function that deallocates the memory and allocates new memory
https://apps.sourceforge.net/trac/cppcheck/ticket/336
This commit is contained in:
parent
fba1102689
commit
bf98ff85e5
|
@ -1274,9 +1274,9 @@ void CheckMemoryLeakClass::CheckMemoryLeak_CheckScope(const Token *Tok1, const c
|
|||
while (Token::Match(tok2, "[;{}] ;"))
|
||||
erase(tok2, tok2->tokAt(2));
|
||||
}
|
||||
if ((result = Token::findmatch(tok, "dealloc [;{}] use|use_ ;")) != NULL)
|
||||
if ((result = Token::findmatch(tok, "[;{}] dealloc [;{}] use|use_ ;")) != NULL)
|
||||
{
|
||||
deallocuseError(result->tokAt(2), varname);
|
||||
deallocuseError(result->tokAt(3), varname);
|
||||
}
|
||||
|
||||
// Replace "&use" with "use". Replace "use_" with ";"
|
||||
|
|
|
@ -2307,7 +2307,7 @@ private:
|
|||
" delete [] a;\n"
|
||||
" return 0;\n"
|
||||
"}\n");
|
||||
TODO_ASSERT_EQUALS(std::string(""), errout.str());
|
||||
ASSERT_EQUALS(std::string(""), errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue