Plaintiff states in his brief that “this is not an action to secure contribution of a joint tort-feasor’s proportionate part of a payment on a Judgment . . .; it is an action to secure the entire proceeds available under defendant’s insurance policy to be applied on *635said Judgment as complete reimbursement of the . . . $10,000.00 . . . payment made by William Curtis Garner, who was responsible on this judgment only through Henry Fletcher Garner. . . .” In other words, plaintiff maintains that the 'Complaint states a cause of action to require Nationwide, under the terms of the automobile liability insurance policy issued by it to II. F. Gamer, to pay $10,000 for reimbursement of W. C. Garner for the $10,000 he personally paid on the judgment. This assertion embraces the theory that W. C. Gamer is entitled to indemnity from H. F. Gamer.
“Where two persons are jointly liable in respect to a tort, one being liable because he is the active wrongdoer, and the other by reason of constructive or technical fault imposed by law, the latter, if blameless as between himself and his co-tortfeasor, ordinarily will be allowed to recover full indemnity over against the actual wrongdoer.” Hayes v. Wilmington, 243 N.C. 525, 543, 91 S.E. 2d 673. For example, where liability has been imposed on the master because of the negligence of his servant, and the master did not participate in the wrong and incurs liability solely under the doctrine of respondeat superior, the master, having discharged the liability, may recover full indemnity from the servant. Gadsden v. Crafts & Co., 175 N.C. 358, 363, 95 S.E. 610; Smith v. Railroad, 151 N.C. 479, 66 S.E. 435. It was alleged that Trotter’s judgment was assigned to plaintiff trustee pursuant to G.S. 1-240, but there is no right of indemnity by virtue of that statute. It provides only for contribution as between tort-feasors who are in pari delicto with respect to the same injury, but before that statute was enacted (1929), it was settled law that a tort-feasor whose liability was secondary, upon payment by 'him of the injured party’s recovery, was entitled to indemnity against the primary wrongdoer. Davis v. Radford, 233 N.C. 283, 63 S.E. 2d 822; Gregg v. Wilmington, 155 N.C. 18, 70 S.E. 1070.
It is alleged that W. C. Garner’s insurance carrier paid $10,000 (the limit of its policy) on the $35,000 judgment, W. C. Gamer personally paid an additional $10,000, and the judgment was assigned to plaintiff trustee. Pursuing plaintiff’s theory of the case we assume, though the complaint does not expressly allege, that the judgment plaintiff, Trotter, accepted W. C. Garner’s payment in full compromise settlement of the balance of the judgment. In proper oases the right to indemnity, after judgment, is predicated entirely upon the discharge of the judgment debt. Hodges v. Armstrong, 14 N.C. 253.
When it has been established that one tort-feasor has incurred a legal obligation to indemnify another tort-feasor for payment by the latter of a judgment obtained against them by an injured party, it is *636a type of obligation against which a public liability insurance policy ordinarily insures. The insurance policy in the instant case obligates Nationwide “to pay on behalf of insured all sums which the insured shall become legally obligated to pay as damages because of: Bodily injury . . . sustained by any person, arising out of the use . . . of . . . any non-owned automobile.” Defendant Nationwide contends that it insures only against obligations arising out of insured’s tortious use of an automobile causing injury to another, that the right to indemnity is based on contract implied in law and is not within the coverage of the insurance contract. It is true that we have said that the right of indemnity is not based on any theory of subrogation to the rights of the injured party. Further, that it is based upon a contract implied in law from the circumstance that the passively negligent tort-feasor has discharged an obligation for which the actively negligent tort-feasor was primarily liable. Hunsucker v. Chair Co., 237 N.C. 559, 75 S.E. 2d 768. But defendant’s contention is not sustained. The distinction is more apparent than real. In final analysis the obligation of defendant’s insured to indemnify, if such obligation exists, stems from his wrongful conduct in the -use of an automobile. The theory, contract implied in law, upon which indemnitee establishes his right to indemnity and to be subrogated to the rights of the judgment creditor with respect to the lien and certain incidents of the judgment, does not affect the nature of the transaction which gives rise to insured’s obligation. The courts are divided on the question, but the great weight of authority is that liability for indemnity to a passively negligent tort-feasor ordinarily comes within the coverage of •& public liability insurance policy. Most of the decided cases have arisen under circumstances in which the insured was compelled to pay indemnity and sued his insurer for reimbursement. The matter is summarized thus: . . public liability policies ordinarily are not confined to, and do not contemplate, indemnity only against direct actions by injured persons against the insured; rather, they cover losses which he may suffer by reason of being liable over to another who has been compelled to pay for damages to persons injured because of the negligence or wrongful act of the insured, or his agents, which resulted in such injuries being inflicted. In other words, the insured may sustain a loss from liability to the public on account of personal injuries caused by them, or their workmen, and such loss be brought within the terms of the policy by circuity of action, . . .” Couch, Cyclopedia of Insurance Law, Vol. 5, s. 1165(b), pp. 4136-4137; United States F. & G. Co. v. Virginia Eng. Co., 213 F. 2d 109, 63 A.L.R. 2d 1114 (4th Cir. 1954); Board of Trade Livery Co. v. Georgia Casualty Co., 200 *637N.W. 633 (Minn. 1924); Creem v. Fidelity & Casualty Co., 100 N.E. 454 (N.Y. 1912); Fidelity & Casualty Co. v. Southern R. News Co., 101 S.W. 900 (Ky. 1907). Oux Court is in accord with this principle. R. R. v. Guarantee Corporation, 175 N.C. 566, 96 S.E. 25; Hamilton v. R.R., 203 N.C. 468, 166 S.E. 392.
Assuming for the moment that the complaint states facts sufficient to constitute a cause of action in accordance with plaintiff's contention, it is our opinion that the plaintiff trustee can maintain the action without joining W. C. Garner, his cestui que trust. It is a ffrmly established principle in this jurisdiction that if a judgment debtor, who has a right to indemnity as against another judgment debtor (of the same judgment), pays the judgment and has it cancelled of record or has it assigned to himself, the judgment is extinguished, notwithstanding intention. But if he has assignment made to a trustee for his benefit, the judgment remains in force. The trustee is subrogated to the rights of the judgment creditor with respect to the lien and other incidents of the judgment, for the benefit of his cestui que trust, and may at the request of the beneficiary cause execution to issue or otherwise enforce collection, according to the rights and interest of the beneficiary. Burnett v. Sledge, 129 N.C. 114, 39 S.E. 775; Peebles v. Gay, 115 N.C. 38, 20 S.E. 173; Liles v. Rogers, 113 N.C. 197, 18 S.E. 104; Rice v. Hearn, 109 N.C. 150, 13 S.E. 895; Tiddy v. Harris, 101 N.C. 589, 8 S.E. 227; Hanner v. Douglass, 57 N.C. 262; Barringer v. Boyden, 52 N.C. 187; Hodges v. Armstrong, supra; Sherwood v. Collier, 14 N.C. 380. The foregoing is subject to the rule that the payment in full by a judgment debtor operates as an absolute discharge of the judgment, notwithstanding that an assignment is made to a trustee to keep it alive, if the payor is not, aside from the assignment, entitled to contribution, subrogation or indemnity. 30A Am. Jur., Judgments, s. 1009, p. 867. Most jurisdictions do not require assignment to a trustee or third person on the reasoning that “where the right of subrogation exists an assignment is unnecessary, for that is supplied by equity.” Royal Indemnity Co. v. Becker, 173 N.E. 194, 75 A.L.R. 1481 (Ohio 1930); Muldowney v. Middleman, 107 A. 2d 173 (Pa. 1954). An .assignee of a judgment can maintain an action on it in his own name. Moore v. Nowell, 94 N.C. 265. The assignee of the injured party may maintain an action against the judgment debtor’s insurer. Roth v. General Casualty & Surety Co., 146 A. 202 (N.J. 1929); 85 A.L.R. 38. A trustee may sue in his own name, or he may join his cestui que trust. Mebane v. Mebane, 66 N.C. 334. “. . . (A) trustee of an express trust. . . may sue without j oi-ning with him the person for whose benefit the action is prosecuted.” G.S. 1-63; Chatham v. Realty Co., 180 *638N.C. 500, 105 S.E. 329; Martin v. Mask, 158 N.C. 436, 74 S.E. 343. Where a judgment is assigned to a trustee for the benefit of a judgment debtor, who is entitled to indemnity, the trustee may maintain the action for indemnity without joining the cestui que trust. Searing v.. Berry, 11 N.W. 708 (Iowa 1882); Brown v. Powers, 65 N.Y.S. 733 (1900).
The subrogee of the injured party may sue the primary wrongdoer’s insurance carrier, and the primary wrongdoer is not a necessary party to the action. New York Casualty Co. v. Sinclair Refining Co., 108 F. 2d 65 (10th Cir.1939).
Anyone for whose benefit an insurance policy is issued, covering the legal liability of the insured (as distinguished from a mere indemnity insurance contract), may maintain an action directly against the insurer. Distributing Co. v. Insurance Co., 214 N.C. 596, 200 S.E. 411. The insured must sustain a loss before insurer is liable, and a beneficiary of the policy must comply with the conditions precedent to suit according to the terms of the policy before an action may be instituted against insurer. Small v. Morrison, 185 N.C. 577, 118 S.E. 12; Newton v. Seeley, 177 N.C. 528, 99 S.E. 347. It does not appear from the complaint that it has been judicially established that W C. Garner is entitled to indemnity from H. F. Garner. The policy issued by Nationwide provides that “No action shall lie against the Company unless, as a condition precedent thereto, . . . the amount of the insured’s obligation to pay shall have been finally determined either by judgment against the Insured after actual trial or by written agreement of the insured, the claimant and the Company.” If as plaintiff contends this action involves indemnity as the sole right of recovery, and if it be determined judicially that no right of indemnity exists, then H. F. Garner is entitled to have the judgment cancelled and has incurred no obligation. The question of primary and secondary liability is for the offending parties to adjust between themselves (Bowman v. Greensboro, 190 N.C. 611, 130 S.E. 502), and neither is a party to this action. Futhermore, the policy provides that the insurance company may not be joined in an action to determine insured’s liability. The question of primary and secondary liability could have been, and perchance was, determined in the Trotter action. Where two alleged tort-feasors are sued by the injured party, one may set up a cross-action against the other for indemnity and have the matter adjudicated in that action. Green v. Laboratories, 254 N.C. 680, 690, 120 S.E. 2d 82; Gregg v. Wilmington, supra. And where one who is secondarily liable is sued in tort, he may make the primary wrongdoer a party defendant and assert his right to indemnity and have the matter *639adjudicated in the injured party’s action. Guthrie v. Durham, 168 N.C. 573, 84 S.E. 859. See Cheshire v. Wright, 243 N.C. 441, 90 S.E. 2d 687, for issues submitted to determine the right to indemnity as between master and servant. Where one secondarily liable is sued, he may, after judgment, maintain a separate action against the primary wrongdoer for indemnity. Gregg v. Wilmington, supra. The complaint in the present action is defective in that it does not allege, as a condition precedent to the -right to maintain the action, that the right to indemnity has been determined according to the provisions of the policy. Parenthetically, the facts alleged in the -complaint are insufficient to show that a right to indemnity exists in favor of W. C. Garner.
It is not to be inferred from anything stated in this opinion that the provisions of the policy have been judicially construed with respect to the facts alleged. The allegations of the complaint are too indefinite for construction of the policy. The alleged facts are not sufficiently specific to show that plaintiff’s claim comes within the policy coverage.
We have discussed this case only in the light of what plaintiff contends his cause of action is. There are many -and varied questions we do -not reach. In our opinion the complaint does not sufficiently state a cause of action on any grounds. The court below properly sustained the demurrer. But there was error in dismissing the action. When a demurrer is sustained, the action will be dismissed only if the -allegations of the complaint affirmatively disclose that plaintiff has no cause of action against the defendant. Lumber Co. v. Pamlico County, 250 N.C. 681, 110 S.E. 2d 278.
The portion of the judgment sustaining the demurrer is affirmed, but the portion dismissing the action is stricken. If so advised, plaintiff may move to amend. G.S. 1-131.
Modified and affirmed.