The surety may at any time surrender the principal to the court or magistrate who took the recognizance; provided, that in case any recognizance shall have been certified to some other court, the surrender shall be made to the court when in session; or the surety may at any time commit the principal to the adult correctional institutions, leaving with the warden a certified copy of the recognizance; and upon the surrender or commitment, the surety shall be discharged and exempt from all liability for any subsequent act of the principal, which would have been a breach of the condition of the recognizance.
R.I. Gen. Laws § 12-13-19