shell: Fix memory leak.