Hello Friends,
I have a huge program having multiple malloc & free. At the end of my program, I wish to print the memory leak which has occured.
There are obviously many solutions to this problem.
e.g. Simplest one:
1) When you allocate the memory, keep the allocated memory pointer in a linked list, and remove it once the memory is freed. In the end, traverse through the list and print the left over pointers(which means leaks).
Can you suggest a better solution?
Regards,
Vivek