What is Memory leak?
A defect in which memory obtained with malloc or similar is not released with free after use, and the pointer to it is lost, so the usable memory keeps shrinking. It often happens when an error path returns early and skips the release. In a short program the OS reclaims the memory at exit, so it goes unnoticed, but in servers and embedded devices that run for a long time free memory decreases little by little until an allocation finally fails. Tools such as Valgrind and AddressSanitizer (LeakSanitizer) can detect it.
Japanese name: メモリリーク
Memory leak appears in 2 practice questions across 2 topics, including Linkers, Loaders & Executables, C Programming Basics.
Field: C Programming Basics