Fixed #968 (False positive when TEMP_FAILURE_RETRY used)
This commit is contained in:
parent
8f07e2711c
commit
42ffea4f16
|
@ -1119,7 +1119,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (varid > 0 && Token::Match(tok, "%var% ( fclose|pclose ( %varid% ) ) ;", varid))
|
if (varid > 0 && Token::Match(tok, "%var% ( close|fclose|pclose ( %varid% ) ) ;", varid))
|
||||||
{
|
{
|
||||||
addtoken("dealloc");
|
addtoken("dealloc");
|
||||||
tok = tok->next()->link();
|
tok = tok->next()->link();
|
||||||
|
|
|
@ -345,6 +345,7 @@ private:
|
||||||
ASSERT_EQUALS(";;dealloc;", getcode("char *s; delete [] s;", "s"));
|
ASSERT_EQUALS(";;dealloc;", getcode("char *s; delete [] s;", "s"));
|
||||||
ASSERT_EQUALS(";;dealloc;", getcode("char *s; delete [] (s);", "s"));
|
ASSERT_EQUALS(";;dealloc;", getcode("char *s; delete [] (s);", "s"));
|
||||||
ASSERT_EQUALS(";;dealloc;", getcode("void *p; foo(fclose(p));", "p"));
|
ASSERT_EQUALS(";;dealloc;", getcode("void *p; foo(fclose(p));", "p"));
|
||||||
|
ASSERT_EQUALS(";;dealloc;", getcode("void *p; foo(close(p));", "p"));
|
||||||
|
|
||||||
// if..
|
// if..
|
||||||
ASSERT_EQUALS(";;if{}", getcode("char *s; if (a) { }", "s"));
|
ASSERT_EQUALS(";;if{}", getcode("char *s; if (a) { }", "s"));
|
||||||
|
|
Loading…
Reference in New Issue