Fix memory leak in run_tests()