fix memory leak in test for #18