Fix memory leak in LIST command.