This repo contains some simple but very helpful tools for debugging your code.
check_leaks()
NOW NORMINETTE SAFE!
- Run
make
to create a library of the debug functions - Now you can link the library in your Makefile
- And you can add
check_leaks();
to the end of your main
Here there is a clear memory leak that starts in the "get_commands" function (either memory that doesn't get free'd at the end or something else ...)
-
Ever wondered what the difference is between SEGFAULT and BUS error?
-
A descriptive wiki about memory management:
man RTFM
- Shoutout to Rostyslav Druzhchenko for the leak checker gist
- Go give him a star!