Dynamic heap memory allocation shall not be used
Dynamic heap memory allocation shall not be used.
Dynamic memory allocation uses heap memory, which can lead to issues such as memory leaks, data inconsistency, memory exhaustion, and nondeterministic behavior.
The checker flags uses of the malloc,
calloc, realloc and free
functions, and non-placement versions of the new and
delete operator.
The checker also flags uses of the alloca function. Though
memory leak cannot happen with the alloca function, other issues
associated with dynamic memory allocation can still occur.
If you expect a rule violation but do not see it, refer to Coding Standard Violations Not Displayed.
| Group: Language Support Library |
| Category: Required |