In habeas corpus proceedings, if it appears that the party has been legally committed for any public offense or that he is guilty of such an offense, although his commitment was irregular, he may be remanded to the custody or restraint from which he was taken if the person under whose custody or restraint he was is legally entitled thereto; but, if not so entitled, he must be committed to the custody or restraint of the proper officer or person.
Structure Code of Alabama
Title 15 - Criminal Procedure.
Section 15-21-1 - Persons Entitled to Prosecute Writ - Generally.
Section 15-21-3 - Persons Entitled to Prosecute Writ - Persons Confined as Insane.
Section 15-21-4 - Application to Be Made by Petition; Contents of Petition.
Section 15-21-5 - Description of Party if Name Uncertain or Unknown.
Section 15-21-6 - To Whom Petition Addressed.
Section 15-21-8 - Writ to Be Granted Without Delay; to Whom Writ Returnable.
Section 15-21-9 - Form of Writ.
Section 15-21-12 - Notice to Any Other Person Having Interest Required.
Section 15-21-14 - Issuance of Precept; Execution of Precept by Sheriff or Constable.
Section 15-21-15 - Subpoenas for Witnesses.
Section 15-21-16 - Service of Writ.
Section 15-21-17 - When Return to Be Made; Form and Contents of Return.
Section 15-21-19 - Proceedings When Person Not Produced on Account of Sickness or Infirmity.
Section 15-21-21 - When Party to Be Discharged or Remanded.
Section 15-21-23 - Judgment, etc., or Contempt Commitment Not to Be Inquired Into.
Section 15-21-24 - Grounds for Discharge of Person in Custody Under Process Legally Issued.
Section 15-21-26 - Reimprisonment for Same Cause After Discharge.
Section 15-21-28 - Penalty - Refusal or Neglect to Deliver True Copy of Detention Order, Etc.
Section 15-21-30 - Attachment to Compel Obedience and Punish for Contempt.
Section 15-21-31 - Penalty for Transferring Custody, etc., So as to Elude Service or Effect of Writ.
Section 15-21-32 - Proceedings Against Defaulting Witnesses.
Section 15-21-33 - Taxation and Collection of Fees and Costs of Witnesses.
Section 15-21-34 - Summoning and Compensation of Guards to Convey Prisoner.