Memory Management (MEM)
- MEM00-C. Allocate and free memory in the same module, at the same level of abstraction
- MEM01-C. Store a new value in pointers immediately after free()
- MEM02-C. Immediately cast the result of a memory allocation function call into a pointer to the allocated type
- MEM03-C. Clear sensitive information stored in reusable resources
- MEM04-C. Beware of zero-length allocations
- MEM05-C. Avoid large stack allocations
- MEM06-C. Ensure that sensitive data is not written out to disk
- MEM07-C. Ensure that the arguments to calloc(), when multiplied, do not wrap
- MEM10-C. Define and use a pointer validation function
- MEM11-C. Do not assume infinite heap space
- MEM12-C. Consider using a goto chain when leaving a function on error when using and releasing resources
Information for Editors
In order to have a new guideline automatically listed above be sure to label it mem and recommendation .
Risk Assessment Summary
Rule | Severity | likelihood | Detectable | Repairable | Priority | Level |
|---|---|---|---|---|---|---|
MEM00-C | High | Probable | Medium | P12 | L1 | |
MEM01-C | High | Unlikely | Low | P9 | L2 | |
MEM02-C | Low | Unlikely | Low | P3 | L3 | |
MEM03-C | Medium | Unlikely | High | P2 | L3 | |
MEM04-C | Low | Likely | Medium | P6 | L2 | |
MEM05-C | Low | Likely | Medium | P6 | L2 | |
MEM06-C | Medium | Unlikely | High | P2 | L3 | |
MEM07-C | High | Unlikely | Medium | P6 | L2 | |
MEM10-C | High | Unlikely | High | P3 | L3 | |
MEM11-C | Low | Probable | High | P2 | L3 | |
MEM12-C | Low | Probable | Medium | P4 | L3 | |
MEM30-C | High | Likely | Medium | P18 | L1 | |
MEM31-C | High | Probable | Medium | P8 | L2 | |
MEM33-C | Low | Unlikely | Low | P3 | L3 | |
MEM34-C | High | Likely | Medium | P18 | L1 | |
MEM35-C | High | Probable | High | P6 | L2 | |
MEM36-C | Low | Probable | High | P2 | L3 |


