memleak: removed false positives for pclose (#286)
This commit is contained in:
parent
51beadd81c
commit
a32114b15c
|
@ -486,7 +486,7 @@ Token *CheckMemoryLeakClass::getcode(const Token *tok, std::list<const Token *>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Token::Match(tok->previous(), "[;{})] %var%"))
|
if (Token::Match(tok->previous(), "[;{})=] %var%"))
|
||||||
{
|
{
|
||||||
AllocType dealloc = GetDeallocationType(tok, varnames);
|
AllocType dealloc = GetDeallocationType(tok, varnames);
|
||||||
if (dealloc != No)
|
if (dealloc != No)
|
||||||
|
|
|
@ -2119,7 +2119,7 @@ private:
|
||||||
" FILE *f = popen (\"test\", \"w\");\n"
|
" FILE *f = popen (\"test\", \"w\");\n"
|
||||||
" int a = pclose(f);\n"
|
" int a = pclose(f);\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
TODO_ASSERT_EQUALS(std::string(""), errout.str());
|
ASSERT_EQUALS(std::string(""), errout.str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue