If you overload operator new in global scope, you should also overload operator delete in global scope. Likewise, overloading operator new in the scope of a class mandates the overloading of operator delete in the same class. Failure to overload operator delete will cause the global delete to be called to release a resource that was allocated with an overloaded operator new. Violation of this rule is likely to also violate MEM39-CPP. Resources allocated by memory allocation functions must be released using the corresponding memory deallocation function
Risk Assessment
Mismatched usage of new and delete could lead to a denial-of-service attack.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
DCL35-CPP | low | unlikely | low | P3 | L3 |
Bibliography
TODO
DCL34-CPP. Use volatile for data that cannot be cached 02. Declarations and Initialization (DCL) DCL36-CPP. Do not declare an identifier with conflicting linkage classifications