Abdullah bin al-Hasan (may Allah have mercy on him) narrates from Sayyidah Umm Salamah (may Allah be pleased with her) that, concerning a slave of hers who had asked her for his freedom, she swore an oath and said: May Allah never free me from the Fire if I ever free him. Then she remained (so) for as long as Allah willed, and then said: Subhan Allah! I heard the Messenger of Allah (peace and blessings be upon him) say: "Whoever swears an oath about something and then sees something better than it, let him make expiation for his oath and then do that which is better." So I freed the slave, and then made expiation for my oath.
Hadith Referenceالمعجم الكبير للطبراني / مسند النساء / 19998