Appeal from a judgment of the Supreme Court at Special Term (Pennock, J.), entered December 29, 1980 in Ulster County, which dismissed a writ of habeas corpus following a hearing. Petitioner sought a writ of habeas corpus claiming that he was illegally detained based on defective accusatory instruments filed in the Town of Poughkeepsie Justice Court. His petition was dismissed following a hearing. It is clear from the record that prior to the hearing on this petition, petitioner was convicted of unrelated robbery charges, sentenced and committed to the custody of the Commissioner of Corrections of New York State. In view of this fact, petitioner would not be entitled to immediate release and, consequently, the remedy of habeas corpus is not available to him (People ex rel. Mendolia v Superintendent of Green Haven Correctional Facility, 47 NY2d 779; People ex rel. Lane v Vincent, 32 NY2d 940). The judgment, therefore, must be affirmed. Judgment affirmed, without costs. Sweeney, J. P., Kane, Main, Casey and Herlihy, JJ., concur.