CertCRecommendations-MEMΒΆ

Memory Management

Nested Rules

CertC-MEM00

Allocate and free memory in the same module, at the same level of abstraction

CertC-MEM01

Store a new value in pointers immediately after free()

CertC-MEM02

Immediately cast the result of a memory allocation function call into a pointer to the allocated type

CertC-MEM03

Clear sensitive information stored in reusable resources

CertC-MEM04

Beware of zero-length allocations

CertC-MEM05

Avoid large stack allocations

CertC-MEM06

Ensure that sensitive data is not written out to disk

CertC-MEM10

Define and use a pointer validation function

CertC-MEM11

Do not assume infinite heap space

CertC-MEM12

Consider using a goto chain when leaving a function on error when using and releasing resources

Options