Skip to content

Memory leak checker in C using wrapper functions for malloc and free.

Notifications You must be signed in to change notification settings

IamTheKaaZZ/42_memleak_check

Repository files navigation

Simple memory leak checker for 42 students

This repo contains some simple but very helpful tools for debugging your code.

Current debug functions

check_leaks()

NOW NORMINETTE SAFE!

How to use:

  1. Run make to create a library of the debug functions
  2. Now you can link the library in your Makefile
  3. And you can add check_leaks(); to the end of your main

Example output when a memory leak is caught:

Example output when there is a memory leak

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 ...)

Some helpful links to practice the fine art of RTFM

  1. Ever wondered what the difference is between SEGFAULT and BUS error?

    SEGFAULT VS BUS

  2. A descriptive wiki about memory management:

    Memory Management

Halp I still don't know how to debug my code!

man RTFM

Shoutouts

About

Memory leak checker in C using wrapper functions for malloc and free.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages