State law permits spouses to allocate marital assets in a postnuptial agreement if a spouse commits adultery, the Maryland Supreme Court has held.