If any person is committed to prison, or is in custody of any officer on any criminal charge, by virtue of any warrant of commitment of a judge, such person shall not be discharged on the ground of any mere defect of form in the warrant of commitment.