Most of memory leaks appear when a pointer of an object returned and programmer forgot to delete it.
for example:
class my_class
{
...
};
my_class
You haven't resolved any memory leaks. If you new, then you must delete. All you did was dereference the pointer, it still needs to be deleted. You can resolve memory leaks by creating local objects and returning by value, or using smart pointers. 99 times out of 100, I prefer the return by value option.
Now, like many beginners, the idea of returning large objects by value probably scares your perf-centric mind. Read this to allay your fears.