
246 Cal.App.2d 541 (1966)
NORMAN WONG, Petitioner,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; FRED K. WONG, Real Party in Interest.
Civ. No. 30701. 
California Court of Appeals. Second Dist., Div. Four.  
Nov. 18, 1966.
 Kwan, Cohen & Lum and Arthur D. Cohen for Petitioner.
 No appearance for Respondent.
 Fred K. Wong, in pro. per., for Real Party in Interest.
 CHANTRY, J. pro tem.  [fn. *]
 This is a request by petitioner after judgment for a writ of prohibition preventing said respondent superior court from enforcing that portion of its interlocutory judgment ordering forthwith payment of attorney fees to the petitioner's former attorney, Fred K. Wong, from the community property in petitioner's possession.
 Petitioner, Norman W. Wong, is the plaintiff and cross-defendant in a divorce action. He was represented in said action by Attorney Fred K. Wong, real party in interest. The court received testimony as to the value of the services performed for the husband and wife from their respective attorneys and then advised both counsel to amend the pleadings to conform to the proof and to include a prayer for attorney fees. Counsel for the wife stated the wife's pleadings covered the subject.
 The petitioner's attorney on May 20, 1966, pursuant to stipulations of respective counsel in open court, filed an amendment to the complaint "... To Conform to Proof," in which it is alleged "That he will require the services of an attorney to prosecute this action and to defend the cross- complaint. ... That he has agreed to pay such attorney a reasonable fee for his legal services. ... The reasonable value of such attorneys fees and Court and administrative costs would be a proper charge to the community property of the parties herein. That to date ... Norman Wong [petitioner herein] has incurred the total sum of Forty-Four Thousand Eight Hundred and Fifty Dollars ($44,850.00) for the reasonable value of the legal services rendered to him and the community by [attorney] Fred K. Wong." He further alleges court and administrative costs in the sum of Thirty-seven Thousand Six Hundred Thirty- six Dollars and Three Cents ($37,636.03). By the prayer petitioner requests that both these sums be allowed by the court as reasonable and proper charges against the community property of the parties.
 On May 20, 1966, petitioner discharged Attorney Wong and engaged his present counsel to prepare objections to the *545 request for attorney fees by filing a "... Motion to Set Aside Submission as to Issue of Reasonable Attorney's Fee Only and to Reopen Case. ..." This motion was heard and denied by the trial judge on June 8, 1966.
 On June 9, 1966, an Interlocutory Judgment of Divorce was filed. This decree declares that the community property has a value of $68,158.31. The decree then lists "community obligations" totaling $68,158.61 which the plaintiff is ordered to pay "forthwith." One of the debts so listed is "Attorney's fees for Fred K. Wong $31,060.00."
 [1] "Section 387 of the Code of Civil Procedure provides in relevant part that 'At any time before trial, any person, who has an interest in the matter in litigation, or in the success of either of the parties, or an interest against both, may intervene in the action or proceeding.' [1] However, 'The right of an attorney to intervene for the purpose of settling a dispute between him and his client as to attorney's fees for services rendered in the same action is limited to those actions wherein, by virtue of the contract of employment between the attorney and client, the former is given a specific present interest in the subject matter of the action, which interest might be jeopardized by the client's discharge of his original attorney and the employment of another to prosecute the action. [Citations.]' [Citations.]"
 [2] "[2] The ... attorney in a divorce action has no such interest in the matter in litigation, or in the success of either of the parties, or an interest against both, as would entitle him to intervene in the action or proceeding. (Schwartz v. Schwartz (1953) 119 Cal.App.2d 102, 104-105 [3, 4] [259 P.2d 33].) ...." (Meadow v. Superior Court, 59 Cal.2d 610, 615 [30 Cal.Rptr. 824, 381 P.2d 648].)
 [3] Although attorney fees allowed may in the discretion of the court be made payable to the attorney, they are granted for the benefit of the party concerned. An attorney's right thereto is indirect and is derived from his client. (Marshank v. Superior Court, 180 Cal.App.2d 602, 606 [6] [4 Cal.Rptr. 593].)
 [4] "[4] And 'it is only the party who has the right to apply for an award of attorney's fees and section 137.3 and 137.5 [of the Civil Code] do not give the attorney for a party, either before or after any discharge of his services by his client, the right to make a motion in his own behalf for an award of such fees ... and the trial court is without jurisdiction *546 to ... proceed with such motion or to make any award thereunder.' (Marshank v. Superior Court (1960), supra, pp. 607-608 [9, 10].)" (Meadow v. Superior Court, 59 Cal.2d 610, 616 [30 Cal.Rptr. 824, 381 P.2d 648].)
 [5] The motion of Attorney Wong for attorney fees was not a motion under Civil Code section 137.5. The plaintiff had no need for funds to enable him to maintain his action against his wife. He had control of the community estate and is presumed to be using it in the litigation (and he had been) so far as his necessities require. The allowance of fees under sections 137.3 and 137.5 is premised on the theory of need by one of the parties without adequate funds to meet the legal expenses and fees that can reasonably be expected to be incurred and the ability of the other party (husband or wife) to furnish such funds. For the court to have allowed attorney fees to the plaintiff in this case on the premise of need would not have been an exercise of proper discretion, Mudd v. Mudd, 98 Cal. 320 [33 P. 114], as he had custody and management of a sufficient portion of the community property.
 The court was advised that this was a request for fees pursuant to the terms of a contract between the plaintiff and his then lawyer for reasonable fees. The prayer of the amendment to conform to proof asked only that these fees be allowed by the court as reasonable and proper charges against the community property as a community debt. It was not a request for judgment in favor of Attorney Wong against the plaintiff. Attorney Wong is not a party to the action. [6] "It is the general rule that a judgment may not be entered either for or against a person who is not a party to the proceeding, and any judgment which does so is void to that extent." (In re Wren, 48 Cal.2d 159, 163 [308 P.2d 329]. See also Chase v. Superior Court, 210 Cal.App.2d 872, 876 [27 Cal.Rptr. 383]; Samter v. Klopstock Realty Co., 31 Cal.App.2d 532, 535 [88 P.2d 250]; Overell v. Overell, 18 Cal.App.2d 499 [64 P.2d 483]; 1 Witkin, Cal. Procedure (1954) Jurisdiction,  136, p. 398.) [7] A judgment for attorney fees in favor of Attorney Wong in this action exceeded the jurisdiction of the court, since he was not proceeding by separate action or under the authority of 137.5. The plaintiff in his amendment to the complaint sought to have the fees of his attorney allowed as a community obligation to be deducted from the gross value of the community property before a division was made. He now finds himself subject to an order which the court is treating as a judgment for the payment of attorney fees in favor of one not a party to *547 the action and thereby adjudicating the amount of the fee as between Fred Wong and his client, Norman Wong, and permitting the attorney to enter what purports to be an enforceable judgment against his own client.
 [8] It is the duty of the court in dissolving a marriage to make an order for disposition of the community property. (Civ. Code,  146.) It is settled that the community property that must be distributed on dissolution of the community by divorce is the residue that remains after discharge of the community obligations. [9] "Before a division of the community property can be made legally, the nature of certain debts charged against the husband must be definitely ascertained. If it is determined that they are community debts, then they should be deducted from the gross value of the community property before a division is made." (16 Cal.Jur.2d, Divorce and Separation,  295, p. 593; McKannay v. McKannay, 68 Cal.App. 701 [230 P. 214]; Johnston v. Johnston, 33 Cal.App.2d 90 [91 P.2d 142].) An order granting a new trial on the ground that the judgment was against the law was upheld in Rethers v. Rethers, 140 Cal.App.2d 28 [294 P.2d 968], where the court awarded all community property to the wife without making a finding on the material question of the amount of the community debts.
 [10] Defendant Rita Chow Wong did not raise any issue as to the attorney fees requested by said amendment being unreasonable or an improper charge against the community estate. When the issue of community debts is before the court and the community property is about to be divided, there appears to be no sound reason for the court not to consider the husband's liability to his attorney in determining the amount of community property which will remain for distribution as it would consider any other community debt which is not in dispute.
 [11] Each party was granted a divorce on the grounds of extreme cruelty. Each party was entitled to a full one-half share of the community property. (Bordin v. Bordin, 193 Cal.App.2d 132 [13 Cal.Rptr. 837]; Dickson v. Dickson, 225 Cal.App.2d 752 [37 Cal.Rptr. 718]; De Burgh v. De Burgh, 39 Cal.2d 858, 874 [250 P.2d 598].)
 Insofar as the May 20th amendment to the complaint was a request to the court that it consider the amount of Norman Wong's attorney fees as a charge against the community property no exception can be taken to it. In making this *548 request to the court, Attorney Fred Wong was acting on behalf of his client and in his client's interest.
 The error of the respondent court, and of real party in interest, is in assuming that this request authorized or permitted the court to adjudicate the amount of the fee, as between Fred Wong and his client Norman Wong, and enter what purports to be an enforceable judgment in favor of the attorney against his own client.
 [12] Entirely apart from the absence of express statutory authorization, the judgment in this case ordering Norman Wong to pay his own attorney deprives petitioner of his property without due process of law. Such an order cannot be equated with a direction to pay opposing counsel or to pay an acknowledged family creditor.  [fn. 1] Norman Wong, through his counsel, could effectively assert any defense he might have against the claims of his wife's attorney. And if he disputed the validity or amount of any of the family bills, his attorney could present that fact to the court before any order was made directing him to pay them. [13] But the procedure of a divorce action affords a party no opportunity to litigate any legal defenses or offsets he may have against his own attorney's claim for fees. As between Norman Wong and his attorney Fred Wong, the former was wholly defenseless and unrepresented in this action.
 [14] Fred Wong now argues that the judgment was proper because Norman Wong agreed to it. This argument is based upon a mistaken concept of consent. The pleadings here show that after the court announced on May 18 what it intended to do, Norman Wong discharged Fred Wong and employed another attorney and on June 8 a hearing was held before the respondent court at which evidence was taken concerning Norman Wong's consent. From the record before us now (including the partial transcript of the June 8 hearing) it is apparent that Norman Wong agreed that attorney fees be paid out of community property and that he would pay Fred Wong a reasonable fee which would be not less than the fees paid to his wife's attorneys. Such an agreement may constitute an enforceable contract (absent equitable defenses) but it does not confer jurisdiction upon a court which does not have jurisdiction otherwise.
 Real party in interest points out that his client was benefited by the decision of the court to treat the attorney fees as a *549 community debt. He assumes that in order to obtain this benefit for his client he had to obtain a judgment ordering his client to pay. This does not follow. The trial court could have estimated the amount of the fee as a part of its calculation of the community property. To prevent a windfall to the husband in the event he settled his fee for less than the estimate, the court could have ordered him to divide the savings with his wife. If there was any suggestion that he might evade that obligation to his spouse, security could have been required. But an order to pay Fred Wong, forthwith, was not required for the benefit of either party to the divorce action. No one could have been benefited by it except Fred Wong, a nonparty, whose only proper concern in that litigation was the welfare of his client and the just disposition of the issues regularly before the court.
 We note that in the June 8 hearing it was developed that Norman Wong had previously paid to Fred Wong $8,100 on account of attorney fees. The amendment to the complaint which Fred Wong filed, purportedly on behalf of his client, alleged the reasonable value of the services and prayed payment of the entire amount, without any mention of partial payments.  [fn. 2] We note also that at the June 8 hearing Norman Wong claimed that Fred Wong was indebted to him for loans, which would be offset. The respondent court replied: "The Court: Well, any personal offset as between Mr. Norman Wong and Mr. Fred Wong that relates to other transactions would not be properly before this Court to pass upon. It is not properly before the Court."
 This latter statement was correct. But in a court which had jurisdiction to determine a controversy between Norman Wong and Fred Wong, such matters would have been relevant. This is one more reason why the divorce action was not the place to determine the amount which Norman Wong should be ordered to pay to his attorney. [15] Due process of law does not permit an attorney to step out of his fiduciary role temporarily and obtain a judgment for his own benefit against his client who is for the time being unrepresented and disabled from presenting any defenses and offsets.
 The judgment entered June 9, 1966, insofar as it orders petitioner to pay "forthwith" the sum of $31,060 is in excess *550 of the jurisdiction of the respondent court. Let a writ of prohibition issue prohibiting the enforcement of that portion of the judgment.
 Files, P. J., and Jefferson, J., concurred.
NOTES
[fn. *]  *. Assigned by the Chairman of the Judicial Council.
[fn. 1]  1. See Wilson v. Wilson, 33 Cal.2d 107 [199 P.2d 671].
[fn. 2]  2. We do not suggest that there was any intent to deceive the court. The offset was acknowledged in the record. Our point is that this pleading was not a proper one to be used as a basis for a judgment in favor of Fred Wong against Norman Wong.
