Last Updated: June 6, 2026
A memory leak in C++ is an allocation on the heap that nothing in the program can reach anymore, and that nothing ever frees. The earlier chapter on dangling pointers introduced the basic shape of a leak. This chapter goes further: the common patterns that cause leaks in code, how to reason about ownership to stop creating them, and the tools that find the ones missed during development.