Skip to content

Commit eaa5a5f

Browse files
authored
Merge pull request #809 from geoffw0/enclosing
CPP: Small change to 'Resource not released in destructor'
2 parents bfb8125 + 175ff96 commit eaa5a5f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,7 @@ predicate freedInSameMethod(Resource r, Expr acquire) {
191191
exists(Expr releaseExpr, string kind |
192192
r.acquisitionWithRequiredKind(acquire, kind) and
193193
releaseExpr = r.getAReleaseExpr(kind) and
194-
releaseExpr.getEnclosingFunction().getEnclosingAccessHolder*() = acquire.getEnclosingFunction()
195-
// here, `getEnclosingAccessHolder*` allows us to go from a nested function or lambda
196-
// expression to the class method enclosing it.
194+
releaseExpr.getEnclosingElement+() = acquire.getEnclosingFunction()
197195
)
198196
}
199197

0 commit comments

Comments
 (0)