This rule finds
delete expressions whose argument is a pointer that points to memory
allocated using the
malloc function, and calls to
free whose argument is a
pointer that points to memory allocated using the
new operator. Behavior in such cases
is undefined and should be avoided.
delete operator when freeing memory allocated with
new, and the
free function when freeing memory allocated with
- isocpp.org 'Standard C++', "Can I free() pointers allocated with new? Can I delete pointers allocated with malloc()?"
- Wikipedia, "Relation to malloc and free" in new and delete (C++).
- Common Weakness Enumeration: CWE-401.