46-22-101. Applicability of writ of habeas corpus.
(1) Except as provided in subsection (2), every person imprisoned or otherwise restrained of liberty within this state may prosecute a writ of habeas corpus to inquire into the cause of imprisonment or restraint and, if illegal, to be delivered from the imprisonment or restraint.
(2) The writ of habeas corpus is not available to attack the validity of the conviction or sentence of a person who has been adjudged guilty of an offense in a court of record and has exhausted the remedy of appeal. The relief under this chapter is not available to attack the legality of an order revoking a suspended or deferred sentence.
46-22-102. No release for technical defects.
A person may not be released on a writ of habeas corpus due to any technical defect in commitment not affecting the person's substantial rights.
46-22-103. Writ for purpose of bail.
When a person is imprisoned or detained in custody on any criminal charge for want of bail, the person is entitled to a writ of habeas corpus for the purpose of giving bail upon averring that fact in the person's petition, without alleging that the person is illegally confined.