CertC++-MEMΒΆ

Memory Management

Nested Rules

CertC++-MEM30

Do not access freed memory

CertC++-MEM31

Free dynamically allocated memory when no longer needed

CertC++-MEM34

Only free memory allocated dynamically

CertC++-MEM35

Allocate sufficient memory for an object

CertC++-MEM36

Do not modify the alignment of objects by calling realloc()

CertC++-MEM50

Do not access freed memory

CertC++-MEM51

Properly deallocate dynamically allocated resources

CertC++-MEM52

Detect and handle memory allocation errors

CertC++-MEM53

Explicitly construct and destruct objects when manually managing object lifetime

CertC++-MEM54

Provide placement new with properly aligned pointers to sufficient storage capacity

CertC++-MEM55

Honor replacement dynamic storage management requirements

CertC++-MEM56

Do not store an already-owned pointer value in an unrelated smart pointer

Options