tests: Fix some memory leaks
reset: Fix a memory leak