If we would like to check for memory leaks in a C++ program, we can overload the new and delete operators to keep track of the memory that was allocate
new
delete
Here is how you can modify malloc, free hooks : Hooks for Malloc