Ángel
@angel@triptico.com
valgrind
, libleak
or the scan-build
tool from the LLVM compiler. There is a less known tool inside the GCC compiler itself: the -fsanitize=address
.If you use a standard make setup, you can recompile your project doing
make CFLAGS="-fsanitize=address -fno-omit-frame-pointer"After exiting your program, a summary of memory leak errors (including the line of the source code were it happened) will be printed out.