mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
This adds a `NewOrNewArrayExpr.getPlacementPointer` predicate and uses it in `Alloc.qll` to detect when a `new`-expression is not an allocation. User-defined replacements for `operator new` may not be allocations either, but the code continues to assume that they are. It's possible that we want to change this assumption in the future or leave it up to individual queries to decide on which side to err. It's hard to statically tell whether `operator new` has been overloaded in a particular file because it can be overloaded by a definition that is not in scope but is only linked together with that file.
13 lines
809 B
Plaintext
13 lines
809 B
Plaintext
| my_auto_ptr.cpp:55:23:55:27 | new | This memory is never freed |
|
|
| my_auto_ptr.cpp:57:25:57:29 | new | This memory is never freed |
|
|
| my_auto_ptr.cpp:71:38:71:58 | new | This memory is never freed |
|
|
| my_auto_ptr.cpp:80:12:80:18 | new | This memory is never freed |
|
|
| my_auto_ptr.cpp:81:15:81:21 | new | This memory is never freed |
|
|
| my_auto_ptr.cpp:82:9:82:15 | new | This memory is never freed |
|
|
| test.cpp:26:18:26:23 | call to malloc | This memory is never freed |
|
|
| test.cpp:42:18:42:23 | call to malloc | This memory is never freed |
|
|
| test.cpp:73:18:73:23 | call to malloc | This memory is never freed |
|
|
| test.cpp:89:18:89:23 | call to malloc | This memory is never freed |
|
|
| test.cpp:156:3:156:26 | new | This memory is never freed |
|
|
| test.cpp:157:3:157:26 | new[] | This memory is never freed |
|