
135 Cal.App.2d 604 (1955)
In re RONALD DEAN HOWE, on Habeas Corpus.
Crim. No. 2644. 
California Court of Appeals. Third Dist.  
Sept. 23, 1955.
 Galen W. Bay for Petitioner.
 Edmund G. Brown, Attorney General, Doris H. Maier, Deputy Attorney General, and Bruce A. Werlhof, District Attorney (Tehama County), for Respondent.
 VAN DYKE, P. J.
 Petitioner was informed against on a charge that he had been guilty of violating section 459 of the Penal Code, burglary, in that he had entered a house or dwelling with the intent therein to commit theft. He was tried before the court, a jury having been waived. After the evidence had been received the court took the matter under submission and filed in the cause a document entitled "Memorandum Decision." Therein it was declared that the proof against the petitioner did not justify the court in holding that petitioner had entered the building wrongfully or with any intention to commit theft therein. No formal judgment was entered acquitting petitioner of the charge of burglary, but in view of what the trial court stated above and in view of the further action of the trial court, we think it clear that in legal effect petitioner was acquitted of the charge of burglary. In the filed memorandum of decision the trial court further declared:
 "It appears, however, that the defendant did 'go along' with Hendrix [a co-defendant] after he learned that Hendrix had committed theft. The 'theft' committed was obviously petty theft. Defendant did not report the theft after he had learned of it; he did nothing to discourage the irresponsible minor from carrying out the theft. He must be held to be guilty of the included offense of petty theft."
 [1a] It thus appears that, having been charged with the crime of burglary, having been tried upon that charge, and having been acquitted thereof, he was by the trial court adjudged guilty of petty theft. This charge had never been made against him; he had never been called upon to plead to it; and had not been tried upon it. [2] It is apparent that the trial court purported to find petitioner guilty of petty theft in the belief that it was an included offense. Such, however, is not the law. (People v. Garnett, 29 Cal. 622; People v. Devlin, 143 Cal. 128 [76 P. 900]; People v. Curtis, 76 Cal. 57 [17 P. 941]; People v. Snyder, 74 Cal.App. 138 [239 P. 705]; People v. De Hoog, 100 Cal.App. 235 [279 P. 1076]; People v. Arbaugh, 82 Cal.App.2d 971 [187 P.2d 866].) *606
 Petitioner has been sentenced to serve a term of six months in the county jail. [3] This court issued its writ of habeas corpus directed to the sheriff of the county of Tehama and that official made his return, asserting that he did hold petitioner in custody and that his authority for such imprisonment and restraint was the judgment of the superior court of that county, which followed the filing of the memorandum decision above referred to and which judgment ordered that petitioner be imprisoned "in the Tehama County Jail for the term of six (6) months with credit given for the period of forty-two (42) days" during which he had theretofore been confined.
 We think it clear that petitioner is entitled to be discharged from custody. It is urged that such discharge would be improper under the provisions of section 1506 of the Penal Code, which provides "in all criminal cases after conviction of the defendant where an application for a writ of habeas corpus has been heard and determined in a district court of appeal, either the defendant or the people may apply for a hearing in the Supreme Court." And that if the People "petition for hearing in ... the Supreme Court, the defendant shall not, in any case in which the judgment of conviction has become final, be discharged from custody pending final decision upon the ... petition for hearing and he must, in such cases, be retaken into custody if he has been discharged." [4] We think this code section has no application to the situation presented here. There has been, as to theft, no charge, no trial, no conviction and no judgment. [1b] The purported judgment is for the reasons we have given wholly void.
 It has been further contended that we should not discharge petitioner from custody but should remand him to the custody of respondent sheriff upon the theory that it appears he has been guilty of a crime and that the People should, therefore, be given an opportunity before he be released of initiating a prosecution therefor. It has been held that there are cases in which the suggested disposition should be made on habeas corpus. (See cases cited in McKinney's New Cal. Dig., Habeas Corpus,  67.) However, we think that these cases find no proper application in the case at bar and that on the contrary the admonition contained in section 1484 of the Penal Code controls. It is that the court, after hearing held in a habeas corpus proceeding, should "dispose of such party as the justice of the case may require"; and we are thus authorized and required to order the immediate release and *607 discharge of petitioner from the custody in which he is now held.
 [5] It is argued that, since petitioner has appealed from the judgment of petty theft and that appeal is pending, this court (1) lacks jurisdiction to entertain habeas corpus, and, (2) ought to decline to act except through appellate procedure. In In re Johnston, 3 Cal.2d 32 [43 P.2d 541], the Supreme Court ruled against the first point. Having jurisdiction, we are of the view that we should proceed to discharge petitioner from an illegal imprisonment already too long endured.
 It is ordered that petitioner be by the respondent sheriff discharged from custody.
 Peek, J., and Schottky, J., concurred.
