If, upon such inquiry, the Special Judge does not consider it necessary to take any action under section 15 or section 17, he shall make an order accordingly and the person against whom the inquiry has been conducted shall be discharged and, if he is in custody only for the purpose of the inquiry, he shall be released forthwith. ...