
    The People of State of New York ex rel. Richard Gloss, Appellant, v Joseph Costello, as Superintendent of Mid-State Correctional Facility, Respondent.
    [764 NYS2d 895]
   Appeal from a judgment (denominated order) of Supreme Court, Oneida County (Parker, J.), entered September 4, 2001, which dismissed the petition for a writ of habeas corpus.

It is hereby ordered that the judgment so appealed from be and the same hereby is unanimously affirmed without costs.

Memorandum: Supreme Court properly dismissed the petition for a writ of habeas corpus because the issues raised therein either were raised or could have been raised on direct appeal or by a postjudgment motion pursuant to CPL article 440 (see People ex rel. Mammarello v Donnelly, 286 AD2d 937 [2001]; People ex rel. Woods v Walker, 283 AD2d 991, 991-992 [2001], appeal dismissed and lv denied 96 NY2d 928 [2001]). Moreover, the court properly dismissed the petition because habeas corpus relief does not lie where petitioner would not be entitled to immediate release even if his contentions had merit (see People ex rel. Beam v Hodges, 286 AD2d 936, 937 [2001]; Mammarello, 286 AD2d at 937; People ex rel. Santoro v Hollins, 273 AD2d 829 [2000]). Because “the petition ‘lacked any justiciable basis upon which a writ of habeas corpus could be sustained,’ ” the court did not abuse its discretion in denying petitioner’s application for assigned counsel (People ex rel. Brown v Murray, 284 AD2d 987, 988 [2001], quoting People ex rel. Washington v La Vallee, 34 AD2d 603, 603 [1970], lv denied 27 NY2d 481 [1970]). Present — Pigott, Jr., P.J., Green, Gorski, Lawton and Hayes, JJ.  