Eroxl's Notes
Memory Leak

When a program loses access to allocated space before it has been freed (ie. by reassigning a pointer), the space can no loner be referenced, or freed. This memory therefore remains marked as allocated for the lifetime of the program. Typically memory leaks occur with memory on the heap.

int *i = new int;
int b = 2

*i = 5;
i = &b;

The original address of i was lost and can no longer be freed causing a memory leak