mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
Merge pull request #304 from geoffw0/resource-released
CPP: Fix false positive in AV Rule 79.ql
This commit is contained in:
@@ -159,6 +159,17 @@ predicate unreleasedResource(Resource r, Expr acquire, File f, int acquireLine)
|
||||
)
|
||||
and f = acquire.getFile()
|
||||
and acquireLine = acquire.getLocation().getStartLine()
|
||||
|
||||
// check that any destructor for this class has a block; if it doesn't,
|
||||
// we must be missing information.
|
||||
and forall(Class c, Destructor d |
|
||||
r.getDeclaringType().isConstructedFrom*(c) and
|
||||
d = c.getAMember() and
|
||||
not d.isCompilerGenerated() and
|
||||
not d.isDefaulted() and
|
||||
not d.isDeleted() |
|
||||
exists(d.getBlock())
|
||||
)
|
||||
}
|
||||
|
||||
predicate freedInSameMethod(Resource r, Expr acquire) {
|
||||
|
||||
Reference in New Issue
Block a user