Saeed bin Jubair (may Allah have mercy on him) said: A vain oath is when a person swears an oath to commit a sin. If he abandons the sin, Allah does not hold him accountable for it, but if he commits the sin, he will be held accountable for it. I asked Abu Bishr (may Allah have mercy on him): Then what should he do? He said: He should offer expiation for his oath and abandon the sin.
Hadith Referenceسنن سعید بن منصور / كتاب التفسير / 776