
181 A.2d 625 (1962)
Michael MORETTI,
v.
Harold V. LANGLOIS, Warden.
M. P. No. 1470.
Supreme Court of Rhode Island.
June 7, 1962.
Michael Moretti, pro se.
J. Joseph Nugent, Atty. Gen., Edward A. Capomacchio, Sp. Coun. for State.
ROBERTS, Justice.
This is a petition for habeas corpus. The petitioner is in the custody of the respondent warden pursuant to a sentence of three years imposed upon him by a justice of the superior court on January 25, 1961. This sentence was based upon a violation of the terms under which the imposition of sentence had been deferred by the superior court in the case of State v. Moretti, Indictment No. 29334.
Because the state did not traverse the averments of the petition, the facts, so far as they are material to the issues raised, are not in dispute. It appears therefrom that in September 1954 a grand jury returned an indictment numbered 27143 wherein the petitioner was charged with breaking and entering in the nighttime. On March 15, 1955, pursuant to a hearing held in the superior court, the petitioner was declared to be a defective delinquent and committed as such. While in that status he was thereafter twice paroled, and subsequently each of these paroles was revoked.
*626 It appears that on February 26, 1957 petitioner appeared in a district court and pleaded guilty to a charge of simple assault and was fined $10 and costs. On January 27, 1959 he appeared before the superior court on Indictment No. 27143 and pleaded nolo contendere thereto, and a sentence of eighteen months in the adult correctional institutions was imposed thereon. He thereafter completed the service of this sentence but continued to be held in custody as a defective delinquent. On June 17, 1960 he again appeared in the superior court and, after a hearing, his status as a defective delinquent was terminated and he was discharged by that court from commitment as such. Thereafter, on January 25, 1961, the sentence of three years on Indictment No. 29334, above referred to, and which he is now serving, was imposed.
The petitioner, as we understand him, does not contend that the sentence pursuant to which he is now in custody was imposed illegally. He contends rather that this sentence should be reduced by eighteen months, that being the period of time that he served pursuant to the sentence imposed on January 27, 1959. In support of this contention, he argues that at the time the latter sentence was imposed his status was that of a defective delinquent and that in the circumstances the superior court was without jurisdiction to accept a plea from him. He concludes then that, the court having acted in excess of its jurisdiction in accepting his plea, he is entitled to have the period of the sentence then imposed and served credited to the service of his present sentence. The petitioner advances the same contentions with respect to the district court acceptance of his plea of guilty to a charge of simple assault in 1957. However, because the issue raised in each instance is the same, we shall treat them as constituting one proceeding.
We are unable to concede that these issues have been raised properly in this court by the instant procedure. If it be conceded that the effect of an adjudication of defective delinquency pursuant to the pertinent statutes is to deprive the superior court of jurisdiction to entertain pleas in a criminal proceeding such as were made by petitioner here, habeas corpus would lie to accomplish his discharge from detention then in effect. See Asadoorian for Writ of Habeas Corpus, 48 R.I. 50, 135 A. 322. However, in the instant case the detention that resulted from the alleged illegal sentencing of petitioner has been terminated. He resorts to the writ here in order to nullify a portion of a sentence pursuant to which he is now detained but the legality of which he does not appear to challenge.
In these circumstances we are of the opinion that the question raised as to the effect of an adjudication of defective delinquency upon the competence of a defendant to enter pleas in a criminal proceeding is moot. However liberally this court has treated petitions for the writ with respect to procedural inadequacies, we are not aware that we have ever entertained such a petition for the determination of any issue other than the right of a petitioner, who is then and there under restraint, to be discharged therefrom. The view that we take is well stated in Gobin v. Hancock, 96 N.H. 450, at page 451, 78 A.2d 531, at page 532, wherein the New Hampshire court said: "A person must be imprisoned or otherwise restrained of his personal liberty to be entitled to a writ of habeas corpus. * * * Having been granted his release from imprisonment, the right of the petitioner to the relief he seeks is now a moot question. A determination thereof by this court has therefore become unnecessary and would serve no useful purpose."
The petitioner, obviously being convinced that the sentence imposed upon him in 1959 was illegal, is understandably anxious to avail himself of whatever remedy is at hand in order to ameliorate in some measure the consequences of his allegedly illegal detention pursuant to that sentence. However, as we stated expressly in Lee v. Kindelan, 80 R.I. 212, 95 A.2d 51, the writ of habeas corpus will not be used in this jurisdiction *627 to accomplish a review of alleged errors of law.
The petitioner prays that this court order his present sentence reduced by the amount of time served under the 1959 sentence. He predicates that prayer on his contention that this court "can credit the petitioner * * * to the extent, that the amount of time he was held in custody under these illegal commitments be deducted from his present term * * *." He has failed, however, to direct our attention to any citation of authority, either by way of statute or judicial decision, that supports the bald assertion thus made. The court is not aware that it has ever been granted such authority by statute or that it has ever decided that such authority is among its inherent powers. In short, if we were to assume without deciding that the detention pursuant to the 1959 sentence was illegal, in our opinion we are without any power to order a reduction in the period of time to be served pursuant to a sentence entered by the superior court acting within its jurisdiction.
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 warden.
