Defects that surface after closing can be problematic. Again, the purchase contract may indicate who's responsible. For instance, if the roof was to be watertight at closing and it leaked during the first rain, the sellers may be responsible for fixing it. If a defect is discovered before closing, an attempt should be made to create a written agreement that specifies who will be responsible for repairing it. Without an explicit agreement, it may be unclear who is responsible for fixing the problem.
Ambiguity can lead to trouble.
It's almost always easier to resolve defect problems before closing than it is after closing. If you do find yourself in a situation where a defect surfaces after closing, your first course of action should be to try to resolve it directly with the seller. If the seller is unwilling to help resolve the problem, discuss the problem with the real estate brokers involved. If this doesn't bring satisfaction, talk to a knowledgeable real estate attorney or take the issue up in small claims court if it's a relatively minor problem. Law suits cost money, so this should be a last resort.