Introduction
A memory leak happens when a program keeps using memory but never gives it back. This can make the program slow or crash.
When writing programs that use dynamic memory (like with malloc).
When you want your program to run smoothly without running out of memory.
When debugging why a program gets slower or crashes after running for a while.
When learning how to manage memory properly in C.
When working on long-running programs like servers or games.