Fixed false positive doubleFree (#7401)
This commit is contained in:
parent
23202d9442
commit
f23668dfcc
|
@ -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() == "&")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue