Tamim bin Tarafah (may Allah have mercy on him) narrates: A beggar came to Sayyiduna Adi bin Hatim (may Allah be pleased with him) and asked him for money towards the price of a servant. He said: "I have nothing to give you except my coat of mail and my helmet; I will write to my family to give you both." He was not satisfied (with that), so Sayyiduna Adi (may Allah be pleased with him) became angry and said: "By Allah, I will not give you anything." Then the man became satisfied, so he said: "By Allah, had I not heard the Messenger of Allah (peace and blessings be upon him) saying: 'Whoever swears an oath and then sees what is closer to the fear of Allah, let him do that,' I would not have broken my oath."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 14305