If you have a problem with memory leaks, you need to be more careful. If you allocate memory, you have the duty to liberate. Do not forget this important aspect.
The debugger only helps to look for leaks, but it does not work for you.