Secure Coding Guidelines
- Use only the amount of memory asked using malloc. Make sure not to cross either boundary.
- Free only the memory that was dynamically allocated exactly once.
- Always check the return value of malloc for .
- After every free, re-assign each pointer pointing to the recently freed memory to .
- Zero out sensitive data before freeing it using or a similar method that cannot be optimised out by the compiler.
- Do not make any assumption regarding the positioning of the returned addresses from malloc.