OPINION
BYERS, Presiding Judge.The appellant filed a petition for a writ of habeas corpus in Franklin County ques*892tioning the legality of a judgment entered by the Criminal Court of Davidson County. The trial court held the petition stated no cause upon which the writ could issue and dismissed the petition.
The judgment is reversed and the case is remanded for further proceedings.
On the 12th day of March, 1982, the appellant entered a plea of nolo contendere to violating the state sales tax statutes. The sentence was suspended and the appellant was placed on probation for a period of two years. The appellant was further required to execute an agreement not to engage in business in this state so long as he believed the Sales Tax Act to be unlawful.
The appellant, who is not in custody, and whose sentence of probation has expired, filed the petition attacking that portion of the judgment which required the agreement.
The questions presented are whether that portion of the judgment here complained of comes within the meaning of our Habeas Corpus Act; if so, whether the judgment is void; and whether the appellant may attack the judgment in the county of his residence rather than in the county where the judgment was entered.
T.C.A. § 29-21-101 sets out the subject matter amenable to our writ and provides:
Any person imprisoned or restrained of his liberty, under any pretense whatsoever, except in cases specified in § 29-21-102, may prosecute a writ of habeas corpus, to inquire into the cause of such imprisonment and restraint.
This case does not fall within the exception of § 29-21-102. Therefore, we must determine whether the prohibition of engaging in business under the circumstances set out in the judgment is a restraint of liberty within the meaning of the Act. We think it is.
In State v. McCraw, 551 S.W.2d 692 (Tenn.1977), the Supreme Court held that McCraw, who had served his sentence prior to filing a petition for post-conviction, was restrained of his liberty because the judgment of conviction disenfranchised him. The court permitted McCraw to test the legality of his conviction by way of post-conviction relief. This appellant may test the legality of this restraint by way of a petition for a writ of habeas corpus, even though he is not in custody. See State ex rel. Dillehay v. White, 217 Tenn. 524, 398 S.W.2d 737 (1966).
To obtain relief under the writ, the appellant must show the judgment which causes the restraint of liberty is void.
A judgment is void if, among other things, the court rendering the judgment had no lawful authority to render such judgment. See State ex rel. Anglin v. Mitchell, 575 S.W.2d 284 (Tenn.1979).
The trial judge in this case had jurisdiction to impose a term of incarceration upon the appellant after his plea of nolo contendere and the trial judge had jurisdiction to impose conditions upon the appellant during the terms of the probation. The trial judge did not, however, have unlimited authority to place conditions of probation upon appellant. Such conditions must not only be reasonable, see Stiller v. State, 516 S.W.2d 617 (Tenn.1974), but the condition placed upon a probationer may not exceed the authority vested in the judges of this state.
In the case of Porth v. Templar, 453 F.2d 330 (10th Cir.1971), the U.S. Court of Appeals held the First Amendment to the United States Constitution prohibited a trial court from barring a probationer from expressing questions about the constitutionality of the tax laws. In the case, sub judice, the restraint goes much farther. It prohibits the appellant from engaging in business so long as he believes the sales tax law to be unlawful.
We find the portion of the judgment complained of to be void and thus reachable by way of a petition for habeas corpus.
On the remaining question of whether the appellant may proceed on his application in Franklin County, we also find in favor of the appellant.
T.C.A. § 29-21-105. Place of application for writ.—The application should *893be made to the court or judge most convenient in point of distance to the applicant, unless a sufficient reason be given in the petition for not applying to such court or judge.
In State ex rel. Leach v. Avery, 215 Tenn. 425, 387 S.W.2d 346 (1964), the Supreme Court indicated the statute must be followed on the matters of which forum was appropriate for this type proceeding.
As a result of the foregoing, we find the judgment of the trial court should be reversed. Accordingly, we do so and remand this case to the trial court with instruction to that court to issue the writ of habeas corpus and to declare the portion of the judgment complained of to be null, void, and of no effect.
JONES, J., and WILLIAM P. NEWKIRK, Special Judge, concur.