If the court does not allow the case to be resubmitted or an amended complaint or information filed, the defendant, if in custody, shall be discharged. If the defendant has been released, the release agreement shall be discharged. If the defendant has deposited any security, the security shall be returned to the defendant as provided by law.
ORS 135.680