Fixup memleak of testcase.