If such party be held under illegal restraint or custody, the party shall be discharged, and if not, the party shall be restored to the custody of the person entitled thereto, or left at liberty, as the case may require.
[34:93:1862; B § 382; BH § 3704; C § 3776; RL § 6259; NCL § 11408]