Fix memory leak in MemoryTest_proj