minor

Memory Leak fixed in Memory.cpp (using shared_ptr)