Patch a memory leak