I think this should be `goto err_rollback` to clean up after previous iterations of the loop.