ipops: replace return with goto error to release resources