Skip to content

Commit 060a665

Browse files
committed
update
1 parent 457bc1f commit 060a665

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
@@ -2859,7 +2859,9 @@ void CheckOtherImpl::checkInvalidFree()
28592859
if (std::any_of(op->values().cbegin(),
28602860
op->values().cend(),
28612861
[&](const ValueFlow::Value &value) {
2862-
return value.isSymbolicValue() && value.intvalue == 0;
2862+
if (!value.isSymbolicValue() || !value.isKnown() || value.intvalue != 0 || !value.tokvalue)
2863+
return false;
2864+
return value.tokvalue->str() == "new";
28632865
}))
28642866
continue;
28652867
const int var1 = tok->tokAt(varIndex)->varId();

0 commit comments

Comments
 (0)