fix leak in testcase