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
|
||||
{
|
||||
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");
|
||||
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("void *p; foo(fclose(p));", "p"));
|
||||
ASSERT_EQUALS(";;dealloc;", getcode("void *p; foo(close(p));", "p"));
|
||||
|
||||
// if..
|
||||
ASSERT_EQUALS(";;if{}", getcode("char *s; if (a) { }", "s"));
|
||||
|
|
Loading…
Reference in New Issue