At the hearing of the petition, if the prisoner has no visible estate, and takes and subscribes the oath or affirmation prescribed in this Article, the clerk of the superior court before whom he is brought, shall administer the oath or affirmation to him, and discharge him from imprisonment, of which an entry shall be made in the docket of the court.
N.C. Gen. Stat. § 23-27