Fix a memory leak in the test code.