The Messenger of Allah ﷺ said, "Whoever vows to obey Allah, let him obey Him, and whoever vows to disobey Allah, let him not disobey Him."
أن رسول الله ﷺ قال: من نذر أن يطيع الله فليطعه، ومن نذر أن يعصي الله فلا يعصه.
Malik narrated it in the Chapter on Vows and Oaths (8), from Talha bin Abdul-Malik Ayli, from Qasim bin Muhammad bin Siddiq, from Ayesha, and he related it.Bukhari narrated it in the Chapter on Oaths and Vows (6700), by way of Malik.