rctest: Fix memory leak