add test case for memory leak (issue #2)