Miscellaneous-NoMalloc

The library functions “malloc”, “calloc”, “realloc”, and “free” from library <stdlib.h> shall not be used

Required inputs: IR

In C++, memory should be managed automatically using classes such as std::unique_ptr, std::shared_ptr and std::vector.

Note: this rule only reports the C functions,

Possible Messages

Key

Text

Severity

Disabled

stdlib_memory_function_call

Dynamic memory management function from <stdlib.h> is called.

None

False

Options

allow_in_user_new_delete_operator

allow_in_user_new_delete_operator : bool = False

Whether to allow the library functions inside user defined new/delete operator overloads.