mirror of
https://github.com/github/codeql.git
synced 2026-02-20 17:03:41 +01:00
C++: Fix cpp/guarded-free FPs when there are other blocks depending on the guard
This commit is contained in:
@@ -22,5 +22,6 @@ from GuardCondition gc, FreeCall fc, Variable v, BasicBlock bb
|
||||
where
|
||||
gc.ensuresEq(v.getAnAccess(), 0, bb, false) and
|
||||
fc.getArgument(0) = v.getAnAccess() and
|
||||
bb = fc.getEnclosingStmt()
|
||||
bb = fc.getEnclosingStmt() and
|
||||
strictcount(BasicBlock bb2 | gc.ensuresEq(_, 0, bb2, _) | bb2) = 1
|
||||
select gc, "unnecessary NULL check before call to $@", fc, "free"
|
||||
|
||||
Reference in New Issue
Block a user