mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
CPP: Exclude placement new.
This commit is contained in:
@@ -12,7 +12,5 @@
|
||||
| ListDelete.cpp:21:3:21:21 | ... = ... | Resource first is acquired by class MyThingColection but not released anywhere in this class. |
|
||||
| NoDestructor.cpp:23:3:23:20 | ... = ... | Resource n is acquired by class MyClass5 but not released anywhere in this class. |
|
||||
| PlacementNew.cpp:36:3:36:36 | ... = ... | Resource p1 is acquired by class MyTestForPlacementNew but not released anywhere in this class. |
|
||||
| PlacementNew.cpp:37:3:37:51 | ... = ... | Resource p2 is acquired by class MyTestForPlacementNew but not released anywhere in this class. |
|
||||
| PlacementNew.cpp:38:3:38:49 | ... = ... | Resource p3 is acquired by class MyTestForPlacementNew but not released anywhere in this class. |
|
||||
| SelfRegistering.cpp:25:3:25:24 | ... = ... | Resource side is acquired by class MyOwner but not released anywhere in this class. |
|
||||
| Variants.cpp:23:3:23:13 | ... = ... | Resource f is acquired by class MyClass4 but not released anywhere in this class. |
|
||||
|
||||
@@ -34,8 +34,8 @@ public:
|
||||
void *buffer_ptr = buffer;
|
||||
|
||||
p1 = new MyClassForPlacementNew(1); // BAD: not released
|
||||
p2 = new (std::nothrow) MyClassForPlacementNew(2); // BAD: not released
|
||||
p3 = new (buffer_ptr) MyClassForPlacementNew(3); // GOOD: placement new, not an allocation [FALSE POSITIVE]
|
||||
p2 = new (std::nothrow) MyClassForPlacementNew(2); // BAD: not released [NOT DETECTED]
|
||||
p3 = new (buffer_ptr) MyClassForPlacementNew(3); // GOOD: placement new, not an allocation
|
||||
}
|
||||
|
||||
~MyTestForPlacementNew()
|
||||
|
||||
Reference in New Issue
Block a user