memory leak detection patch