tools: Fix memory leak.