A witness imprisoned by an officer under section 2317.22 of the Revised Code may apply to a judge of the supreme court, court of appeals, court of common pleas, or probate court, who may discharge him if it appears that such imprisonment is illegal.
R.C. §2317.24