Skip to content

Commit 7ae750b

Browse files
committed
update
1 parent f25e935 commit 7ae750b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎lib/checkother.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2854,7 +2854,9 @@ void CheckOtherImpl::checkInvalidFree()
28542854
if (std::any_of(op->values().cbegin(),
28552855
op->values().cend(),
28562856
[&](const ValueFlow::Value &value) {
2857-
return value.isSymbolicValue() && value.intvalue == 0;
2857+
if (!value.isSymbolicValue() || !value.isKnown() || value.intvalue != 0 || !value.tokvalue)
2858+
return false;
2859+
return value.tokvalue->str() == "new";
28582860
}))
28592861
continue;
28602862
const int var1 = tok->tokAt(varIndex)->varId();

0 commit comments

Comments
 (0)