Section 116(6) in The Code of Criminal Procedure, 1973
(6)The inquiry under this section shall be completed within a period of six months from the date of its commencement, and if such inquiry is not so completed, the proceedings under this Chapter shall, on the expiry of the said period, stand terminated unless, for special reasons to be recorded in writing, the Magistrate otherwise directs:Provided that where any person has been kept in detention pending such inquiry, the proceeding against that person, unless terminated earlier, shall stand terminated on the expiry of a period of six months of such detention.