In a normal contract there is usually a paragraph that address how much the seller will be willing to pay for repairs (up to a certain % of the sale price or a fixed amount). You didn't mention if you were the buyer or the seller. If you are the buyer, a major problem being found by a home inspection is grounds for you to either walk away or try to negotiate a new price based on several estimated costs (estimates given by a reputable company that is experienced with the type of problem, such as a pluming contract, roofers etc.) If you can come to a meeting of the minds on the price adjustment then the contract is modified and the sale goes forward. If not, you simply walk away from buying the home, you get your escrow deposit back and you find another home to buy.
If you are a seller, my advice is to get a home inspection before you list your house so that you have the opportunity to address any problems before the become issues.