Failing to fix the memory leak