
38 Cal.2d 375 (1952)
EDMUND HAYES et al., Respondents,
v.
RICHFIELD OIL CORPORATION (a Corporation), Appellant.
L. A. No. 21982. 
Supreme Court of California. In Bank.  
Feb. 7, 1952.
 Moss, Lyon & Dunn, Gerold C. Dunn and Henry F. Walker for Appellant.
 Shacknove & Goldman and Ben F. Goldman, Jr., for Respondents.
 GIBSON, C.J.
 Mr. and Mrs. Hayes brought this action to recover damages for personal injuries sustained when Mrs. Hayes fell into the grease pit of a gasoline service station operated by defendant Scavone and leased by him from defendant Richfield Oil Corporation. The jury returned a verdict for plaintiffs, judgment was entered accordingly, and defendant Richfield has appealed.
 The principal contentions are that the evidence is not sufficient to show that Richfield violated any duty which it owed to plaintiffs, that there was a material variance between pleadings and proof, that there were errors in the giving and refusal of instructions, and that plaintiffs were guilty of contributory negligence as a matter of law.
 Mr. Hayes was a regular patron of the station and had taken Mrs. Hayes there on several occasions. He purchased gasoline, oil and accessories from Scavone, and for approximately a year he had been parking his private car on the premises while making business trips in a truck which was kept at a storage place across the street. Scavone had told him he could leave his car at the station while making these trips as long as he continued to trade there. Hayes' working *379 hours were irregular, and he made numerous overnight trips out of town, on some of which he was accompanied by Mrs. Hayes.
 At about 2:30 a. m. on the night of the accident Mr. and Mrs. Hayes left their car at the rear of the station, intending to take a trip in their truck. No attendant was present at the time, and all lights had been turned off except two lights inside the station building. Mr. and Mrs. Hayes walked along one side of the building following a course which was partially illuminated by a street lamp. They crossed the street to where the truck was parked but discovered that it was not in operating condition. They then started to return to their car by a shorter route which led along the other side of the station building where the illumination was not as good and objects could be only vaguely distinguished. Mr. Hayes walked ahead of his wife, and in the darkness she fell into the grease pit. She testified that she was not aware of the existence of the pit, and her husband stated that he knew of its location but did not think about it prior to the accident.
 The pit was parallel to the rear wall of the station building, and it protruded on both sides about 5 feet beyond the extended lines of the building. It had concrete abutments 4 inches high at the ends and steel rails of the same height along the sides. There were sockets for guardrails, and the inventory attached to the lease listed chain guards for the pit, but no such protective devices were ever given to Scavone, and none had been used at any time prior to the accident.
 When the accident occurred the pit was in the same condition as it was when Scavone took possession under his lease from Richfield. The lease recited that the property was designed for the operation of a gasoline service station and required Scavone to use it "primarily for such purpose," to make no material alterations without the lessor's consent and to maintain the premises in good order. In the event of a failure to repair, the lessor reserved the right to enter and make repairs. The lease could be terminated by either party on 24 hours' notice.
 About once a week a Richfield employee called at the station, inspected the grounds and made suggestions with respect to methods of increasing sales. On two occasions, when equipment was in need of repairs, Scavone called the company's maintenance service, which did the necessary *380 work. There was a large "Richfield" sign on the roof of the station and smaller ones on the pumps indicating that Richfield gasoline was for sale. Scavone purchased all his gasoline and oil from Richfield but obtained other merchandise elsewhere. At different times he distributed advertising leaflets and courtesy cards offering free parking to patrons, and from time to time he permitted a number of customers to park their vehicles overnight. Scavone operated the station on a 24-hour basis for a few months after the lease was made and then discontinued selling gasoline between midnight and 6 a. m. Thereafter, during those hours, the only lights left burning were those inside the station building.
 The first question involves the sufficiency of the evidence. Plaintiffs urge that the judgment may be supported on any one of the following theories: (1) that Richfield retained joint control with the lessee over the property and was liable for injuries resulting from dangerous conditions thereon; (2) that Richfield assumed the duty of inspecting the property but performed that duty in a negligent manner; and (3) that the premises were in a dangerous condition when leased, that they were leased for a purpose involving admission of the public, and that the lessor was under a duty to see that they were safe for the purpose intended. We are of the opinion that the evidence was not sufficient to show that Richfield retained joint control or that it assumed the duty of inspecting the property but we need not discuss these contentions in detail since we have concluded that there is ample evidence to support a recovery on the third theory.
 [1] A lessor who leases property for a purpose involving the admission of the public is under a duty to see that it is safe for the purposes intended and to exercise reasonable care to inspect and repair the property before possession is transferred so as to prevent any unreasonable risk of harm to the public who may enter. (Burroughs v. Ben's Auto Park, Inc., 27 Cal.2d 449, 453 [164 P.2d 897]; King v. New Masonic Temple Assn., 51 Cal.App.2d 512, 515 [125 P.2d 559]; Boothby v. Town of Yreka City, 117 Cal.App. 643, 649 [4 P.2d 589].) [2] There is authority that a lessor is not liable if the land is used for a public purpose not contemplated by the lease (see Prosser on Torts [1941] p. 655), but Richfield cannot avoid liability on this ground. The lease to Scavone required him to use the premises "primarily" as a gasoline service station, and not only does this purpose involve admission of the public, but it appears *381 that such purpose would be properly served by the incidental use of a portion of the lot as a free parking space for patrons. [3] In making such a lease the lessor should reasonably anticipate that the lessee might use the premises for activities connected with or in aid of the main business, and here the use of part of the premises for parking as an accommodation to customers of the service station appears to be clearly within the uses contemplated by the lease. [4] There is no merit in Richfield's contention that its responsibility as lessor did not extend to persons who entered the lot when the station was not open for the sale of gasoline. Scavone offered free parking to his patrons and invited Hayes and other customers to park overnight, and this necessarily included an invitation to them to enter the property whenever they wished to leave or pick up their vehicles.
 [5] Although the premises were in the same condition at the time of the accident as they were when possession was delivered to Scavone, Richfield argues that they became dangerous only because Scavone had turned off all the lights at midnight without putting up any protective device around the pit. We cannot say as a matter of law, however, that the premises were safe even when fully illuminated. As we have seen the grease pit was open and unguarded, and while the lease listed chains for the pit as part of the equipment, and there were sockets for guardrails, no such means of protection were furnished to Scavone or placed in use prior to the accident. But if we should assume that the premises were safe when illuminated, there is nothing in the lease which required Scavone to operate the station on a 24-hour basis or to keep it fully lighted throughout the night. In the absence of such requirements, the jury could have concluded that Richfield should reasonably have anticipated that Scavone might not wish to keep the station open day and night, that he might leave the lot dimly lighted when gasoline was not being sold, and that customers might use the parking facilities when the station was not open for the sale of gasoline.
 A more serious problem is presented by the variance between the pleadings and proof. The complaint was framed on the theory that Richfield and Scavone were in joint control of the premises, and there was no allegation of the existence of a landlord and tenant relationship between them. It was alleged, however, that the injuries were caused by a dangerous condition on the premises and that the property *382 was used for purposes involving admission to the public. The existence of the lease was developed through plaintiffs' examination of Scavone under section 2055 of the Code of Civil Procedure, and there was evidence that the premises were leased for use as a service station and were in the same condition at the time of the accident as when leased. In ruling on a motion for nonsuit, the court stated that the case involved the question of Richfield's liability as lessor of property which was leased to be used for a public purpose. Richfield first objected that the court was going beyond the pleadings and then argued that the theory was not applicable to the facts. The same grounds were subsequently urged in support of Richfield's motion for a directed verdict. Upon denial of the motion, Richfield offered an instruction, which was given, pertaining to the duties of a landlord under a lease of property to be used for a purpose involving admission of the public. It should be noted, however, that Richfield did not at any time concede that a cause of action based on this theory was properly presented by the pleadings, and the instruction was offered only because the court had taken the position that the matters covered thereby were within the issues.
 [6] A variance between the allegations of a pleading and the proof will not be deemed material unless it has actually misled the adverse party to his prejudice in maintaining his action or defense on the merits, and a variance may be disregarded where the action has been as fully and fairly tried on the merits as though the variance had not existed. (Code Civ. Proc.,  469; Chelini v. Nieri, 32 Cal.2d 480, 486 [196 P.2d 915]; see Gordon v. Aztec Brewing Co., 33 Cal.2d 514, 523 [203 P.2d 522]; Devens v. Goldberg, 33 Cal.2d 173, 177 [199 P.2d 943]; Genger v. Albers, 90 Cal.App.2d 52, 55 [202 P.2d 569].) [7] In view of the trial court's statements and rulings that the case involved the law relating to a lessor's duty under a lease contemplating admission of the public, Richfield is in no position to claim that it was misled by plaintiffs' failure to amend their complaint. If anything, Richfield's continued insistence that the issue was not presented by the pleadings indicates that it was fully aware that the court's rulings would permit recovery under that theory. It does not appear that Richfield has been in any way prejudiced by the variance, and it may therefore be disregarded. *383
 It is next contended that there was error in the giving of certain instructions, and the first claim is that the court misstated the law relating to a lessor's duty regarding property leased for a purpose involving admission of the public. The following instruction, requested by plaintiff, was modified as indicated: "When property is leased to be used for a public or semi-public purpose, or involving admission of the public, if at the time possession of the premises is delivered to the lessee to be held under the lease thus executed, a condition exists on the leased premises such as to make its intended use dangerous to other persons or their property, and if that condition then is known to the lessor, or if it then would be known to him in the exercise of ordinary care, the lessor becomes liable to an invitee of the lessee for any injury suffered by such invitee and proximately caused by the unsafe condition (provided, of course, that the injured person is not guilty of contributory negligence). Whenever, by virtue of the terms of such a lease, the lessor has the right of re-entry [TEXT STRICKEN]-[before the lessee commences possession under a renewal of the lease or under a new lease for a like purpose,]- the lessor's duty is to exercise that right of re-entry for the purpose of inspecting the premises to the end of removing or preventing any such dangerous condition that reasonable inspection would disclose to him."
 [8] The last sentence of the instruction, as requested, was based on the decision in Burroughs v. Ben's Auto Park, Inc., 27 Cal.2d 449 [164 P.2d 897]. It obviously does not apply here since this case does not involve the renewal of a lease, and the trial court attempted to make the instruction fit the facts by deleting some of the language. Richfield contends that the modification resulted in imposing upon it an absolute duty to enter and inspect for dangerous conditions arising after the transfer of possession. When the whole instruction is read, however, it is clear that the words "any such dangerous condition" in the last sentence necessarily refer to conditions existing on the leased premises at the time possession was transferred to the lessee. Moreover, any doubt in the minds of the jurors must have been removed by the next instruction in which they were again told that the lessor of property which is to be used for a purpose involving admission of the public "is required to exercise only reasonable care to inspect and repair the premises before possession is transferred to the lessee." *384
 [9] The court also instructed the jury that where a lessor retains control of leased property, it has the duty of using reasonable and ordinary care to keep the premises in a safe and suitable condition so that invitees of the tenant will not be unnecessarily or unreasonably exposed to danger. Since the evidence is not sufficient to show that Richfield retained joint control over the leased premises, this instruction should not have been given. The jury was told, however, that under the terms of the lease Richfield retained no right to control the lighting of the premises and that the operation of the parking lot after the station was closed was not an activity which Richfield could control. This instruction tended to offset any possible harm which could have resulted from the challenged instruction, and, under all of the circumstances, we cannot say that there was any miscarriage of justice.
 [10] Complaint is also made that the court should not have given the following instruction: "Even though a lessor is not bound to inspect the premises under the terms of the lease entered into with the tenant, if, despite this fact, he undertakes to make such inspection, he must exercise ordinary care in the making of such inspection." It is argued that the instruction imposes upon a lessor a duty to remedy a dangerous condition which an inspection would reveal. The instruction, however, is not subject to that interpretation and imposes no such duty. Instead it sets forth one aspect of the general rule that a volunteer who undertakes to proceed affirmatively when he is not under a duty to do so must use reasonable care. (See Prosser on Torts [1941] pp. 194-197; cf. Janofsky v. Garland, 42 Cal.App.2d 655, 657 [109 P.2d 750].)
 [11] The trial court properly refused to give instructions requested by Richfield which misstated the law relating to the doctrine of assumption of risk. These instructions were to the effect that one assumes a risk "when he knows, or in the exercise of ordinary care would know, that a danger exists" and voluntarily places himself within the area of danger, and that, to bar recovery, plaintiff must have actual knowledge of the danger "or the conditions must be such that he would have such knowledge if he exercised ordinary care." [12] The doctrine of assumption of risk is based on the theory that there has been a voluntary acceptance of a risk, and such acceptance, whether express or implied, requires knowledge and appreciation of the risk. (See Rest., *385 Torts,  893; Prosser on Torts [1941], pp. 377-386; 10 So.Cal.L.Rev., 67, 74.) [13] Where the facts are such that the plaintiff must have had knowledge of the hazard, the situation is equivalent to actual knowledge, and there may be an assumption of risk; but where it merely appears that a person could or should have discovered the danger by the exercise of ordinary care, the defense is not assumption of risk but contributory negligence. (See Prosser on Torts [1941], pp. 379-380, 400.) There are statements in DeGraf v. Anglo California Nat. Bank, 14 Cal.2d 87, 100 [92 P.2d 899], which appear to ignore the distinction between these defenses, but immediately following the questionable language the opinion correctly states the rule to be that "before it can be said that one has 'assumed the risk' of a specified hazard, it must be shown that he had knowledge of the condition creating the hazard." In the present case the trial court was not required to modify the requested instructions or to supply correct ones, and in any event the question of Mrs. Hayes' awareness and appreciation of the danger was submitted to the jury under other instructions and the implied finding was in her favor.
 [14] Finally, Richfield contends that plaintiffs were guilty of contributory negligence as a matter of law. It is argued that Mr. Hayes, who knew of the location of the pit, was negligent in failing to warn his wife of its existence and that his negligence must be imputed to her. As to Mrs. Hayes, it is argued that she was negligent in proceeding over unfamiliar ground in the darkness instead of returning to the car over the better lighted route by which they had left the premises. The question of contributory negligence, however, was one of fact for the jury, and we cannot say that either plaintiff was negligent as a matter of law. Under the evidence the jury could have concluded that Mr. Hayes was not negligent in failing to keep in mind the existence of the pit or in failing to warn his wife. It could also have found that Mrs. Hayes was not aware of the hazard and did not act unreasonably in assuming that there was nothing of a dangerous character on the premises. (See Neel v. Mannings, Inc., 19 Cal.2d 647, 656 [122 P.2d 576]; Meindersee v. Meyers, 188 Cal. 498, 502-504 [205 P. 1078].) The cases of Medcraft v. Merchants Exchange, 211 Cal. 404 [295 P. 822], and Powers v. Raymond, 197 Cal. 126 [239 P. 1069], *386 relied on by Richfield, are clearly distinguishable on their facts.
 The judgment is affirmed.
 Shenk, J., Edmonds, J., Carter, J., Traynor, J., and Spence, J., concurred.
