
182 A.2d 116 (1962)
John J. deMELLO
v.
Harold V. LANGLOIS, Warden.
M. P. No. 1488.
Supreme Court of Rhode Island.
June 14, 1962.
Leo P. McGowan, Public Defender, Eugene F. Toro, Asst. Public Defender, for petitioner.
J. Joseph Nugent, Atty. Gen., Edward A. Capomacchio, Sp. Counsel, for the State.
CONDON, Chief Justice.
This is a petition for habeas corpus based on the ground that the petitioner's sentence to two years in the adult correctional institutions on the charge of "possession of obscene literature" under indictment No. 4569 is illegal and void. We issued the writ and thereafter the petitioner formally by letter of May 29, 1962 to "Attorney Eugene F. Toro Department of Public Defender," a copy of which is appended hereto, waived oral argument and the right to file a brief. The respondent was also granted leave to waive oral argument and submit his contentions in opposition to the petition solely on brief.
Upon consideration of petitioner's contentions and the authorities cited in support thereof in his petition we are of the opinion that no sufficient reason has been shown therein to entitle him to be discharged from present custody.
On June 30, 1960 he pleaded nolo contendere to a charge of being lewd and wanton and also to the above-mentioned indictment No. 4569. On the first charge he was sentenced to three years and on the indictment to two years in the adult correctional institutions, both sentences to run concurrently. The petitioner has not questioned the validity of the first sentence but contends that the second was illegal because it was based on evidence resulting from an illegal search and seizure.
Habeas corpus does not lie to correct error occurring during the trial or as a substitute for an appeal or bill of exceptions. Asadoorian for Writ of Habeas Corpus, 48 R.I. 50. 135 A. 322. It was within the power of petitioner to have raised the question of illegal search and seizure before pleading nolo but he elected not to do so. Moreover, even if the question were cognizable under the instant petition it would avail him nothing since a decision thereon in his favor could not result in his discharge from custody. Where a finding favorable to a petitioner for habeas corpus *117 cannot result in his release it has been generally held that habeas corpus does not lie. McNally v. Hill, 293 U.S. 131. 55 S.Ct. 24, 79 L.Ed. 238. In the instant cause petitioner is imprisoned under a valid sentence of three years which requires his continued incarceration beyond the two-year sentence of which he complains, therefore the writ would be of no avail to effect his release.
The petition for habeas corpus is denied, and dismissed, the writ heretofore issued is quashed, and the petitioner is remanded to the custody of the respondent.

APPENDIX
"P.O. Box 114
Howard, R.I.
May 29, 1962
"Attorney Eugene F. Toro
Department of Public Defender
Room 202 Prov. County Court House
Providence 3, Rhode Island
"Dear Mr. Toro:
"Re: de Mello v. Langlois
Habeas Corpus
In response to your letter dated May 22, last, you are hereby given my permission to inform the Chief Justice, The Honorable Francis B. Condon, of the R.I. Supreme Court that it is my wish and desire to waive oral argument and the right to file written brief. I feel that my petition is sufficiently [sic] drawn citing the necessary cases and contains sufficient argument for the Court to render an opinion without a brief and without oral argument.
"I have the memorandum which you sent to me and am under the impression that this paper has been filed with the Court. If this is the case please inform me.
"Also, I do not wish neither additions or detractions from my original petition and also that this letter be made as part of the record as you will submit it to the Court as you informed me.
"If the Respondent argues orally I would appreciate being present in the court for rebuttal in that there are pertinent facts of which you are not aware which I would be able to introduce.
"However, If [sic] the Respondent also relies upon his brief and does not argue orally then I would appreciate it if you would forward to me a copy of said brief.
"As of this date I have still to be informed of the M.P. NO, assigned to my petition.
Thank you for your kind attention and I hope I shall hear from you in the very near future.
Respectfully,
[signed] John J. de Mello
John J. de Mello"
