talloc: fixed a use after free error