If the jury be discharged because the facts as charged do not constitute an offense punishable by law, the court must order that the defendant, if in custody, be discharged therefrom, or, if admitted to bail, that the bail be exonerated, or if he have deposited money instead of bail, that the money deposited be refunded to him unless in its opinion a new indictment or information can be framed, upon which the defendant can be legally convicted, in which case it may direct that the case be resubmitted to the same or another grand jury, or a new information filed.
Okla. Stat. tit. 22, § 849