reset: Fix a memory leak