Test case for memory leak issue #414