Memory Safety

Lesson overview

Topics covered: buffer overflows, format strings, secure functions.

Memory Management

Stack: automatic memory, cleared when function returns
Heap: manual allocation with malloc() and free()
int *p = (int *)malloc(sizeof(int) * 10);
Always free(p) when done to prevent leaks.

Article author: Arthur Isaev