We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 492c5f3 commit a71ae2bCopy full SHA for a71ae2b
cpp/ql/src/Critical/NewDelete.qll
@@ -18,10 +18,16 @@ predicate allocExpr(Expr alloc, string kind) {
18
alloc.(AllocationExpr).(FunctionCall).getTarget() = target and
19
(
20
target.getName() = "operator new" and
21
- kind = "new"
+ kind = "new" and
22
+ // exclude placement new and custom overloads as they
23
+ // may not conform to assumptions
24
+ not target.getNumberOfParameters() > 1
25
or
26
target.getName() = "operator new[]" and
- kind = "new[]"
27
+ kind = "new[]" and
28
29
30
31
32
not target instanceof OperatorNewAllocationFunction and
33
kind = "malloc"
0 commit comments