It seems that cleanup only returns res, could be returned from here. So no need for goto stmt with an early return.