Section 15-21-8
Writ to be granted without delay; to whom writ returnable.
(a) The judge to whom the application for a writ of habeas corpus is made must grant the same without delay, unless it appears from the petition itself or from the documents thereunto annexed that the person imprisoned or restrained is not entitled to the benefit of the writ under the provisions of this chapter.
(b) When the person is confined in the penitentiary, the writ must be made returnable before the circuit court of the county in which the convict is confined, but if the writ is granted more than 10 days before the time fixed for the holding of such court, it must be made returnable before the nearest circuit court judge. When a person is a patient or confined in any hospital in the state, the writ must be made returnable before the circuit court of the county in which the hospital is located in which he is so confined. In all other cases, the writ must be made returnable before the officer by whom it is granted.
(Code 1852, §713; Code 1867, §4266; Code 1876, §4942; Code 1886, §4766; Code 1896, §4819; Code 1907, §7014; Code 1923, §4312; Code 1940, T. 15, §8.)