Fixed false positive doubleFree (#7401)

This commit is contained in:
PKEuS 2016-05-04 12:14:42 +02:00
parent 23202d9442
commit f23668dfcc
2 changed files with 8 additions and 1 deletions

View File

@ -516,7 +516,7 @@ void CheckLeakAutoVar::functionCall(const Token *tok, VarInfo *varInfo, const Va
if (_tokenizer->isCPP() && arg->str() == "new")
arg = arg->next();
if (Token::Match(arg, "%var% [-,)]") || Token::Match(arg, "& %var%")) {
if (Token::Match(arg, "%var% [-,)] !!.") || Token::Match(arg, "& %var%")) {
// goto variable
if (arg->str() == "&")

View File

@ -760,6 +760,13 @@ private:
" }\n"
"};", true);
ASSERT_EQUALS("", errout.str());
// #7401
check("void pCodeLabelDestruct(pCode *pc) {\n"
" free(PCL(pc)->label);\n"
" free(pc);\n"
"}");
ASSERT_EQUALS("", errout.str());
}
void doublefree2() { // #3891