Here, two different methods are presented to analyse memory leaks in C code.
The first method is cross-platform. It uses a small Docker image to both run Valgrind on the code and execute the code with the AddressSanitizer.
The second method is exclusive to macOS. It runs leaks
on the code and is a bit simpler than the first method in that it does not use Docker. leaks
should be as performant as Valgrind (although Valgrind has more features and could potentially catch memory leaks that leaks
cannot catch).