LeakSanitizer (LSan) is a memory leak detector for GCC and Clang.
LeakSanitizer (LSan) is a run-time memory leak detector, available since Clang 3.4 and GCC 4.9. It is automatically enabled with AddressSanitizer (ASAN), but can also operate independently.
Once enabled at compile time using the -fsanitize=address
or -fsanitize=leak
, it will automatically be enabled at runtime. To disable that, use LSAN_OPTIONS=detect_leaks=0
.
See also: