Sahih al-Bukhari, Book 83, Hadith 77 (Bukhari 6456)

Narrated `Aisha:

The Prophet (ﷺ) said, "Whoever vowed to be obedient to Allah, must be obedient to Him; and whoever vowed to be disobedient to Allah, should not be disobedient to Him."