Detect memory leaks in C by wrapping raw malloc
and free
APIs
- Keeps track of allocated memory using generic linked list
cmake -B build -G Ninja
- Tested with GCC (10.2) and MSVC (16.8.2) compiler on Windows
- Tested with GCC (9.3) compiler compiler on Linux
# Enter the build folder
cd build
# Build the project
cmake --build .
# Run the test
ctest -V --output-on-failure
- Modify
test/test_mldmalloc.c
- Allocate memory using
mld_malloc
and do notmld_free
- Run the above commands for default testing
# Enter the build folder
cd build
# Build the project
cmake --build .
# Run the test
ctest --output-on-failure
- Location (pointer) of memory leak
- Data size of memory leak
- Unit-Testing
- Code coverage
- CI/CD