Take a look 
here...Chapman v. Engel.  Interesting appellate case from the second district.  Brief facts, plaintiffs entered into contract to purchase defendant's home for $555,000.  At final walk-thru, the property was not in the same condition as when the contract was signed.  P's requested a credit or a repair escrow and D's refused.  $55k was held in escrow as earnest money.  Home eventually sold for $520,000 to another Buyer. 
Court ruled that earnest money should go back to the P's.  Interesting case, the appellate court really dealt with what the definition of a "prevailing party" is.  The case transcript didn't get into how the home was no longer in the condition that it had been when the contract was signed.  I wonder what the issue was. 
NEVER do not do a pre-closing walk-thru!  I see people who don't but I think about 1/4 of the time I'll hear of problems...usually minor but every $$ counts.