Sahih Muslim Book 15, Hadith Number 4057.

Chapter : It is excellent to break the vow if one finds it better doing that which is against this vow one should expiate it.

‘Adi b. Hatim reported Allah’s Messenger (may peace be upon him) as saying: He who took an oath, but he found something else better than that, should do that which is better and break his oath.