If the person complained of is committed for not giving the undertaking required, the person may be discharged by any judge or magistrate upon giving the undertaking.