itss: Reorder some code to avoid leaking memory on an error path.