Two brothers from the Ansar had an inheritance to divide between them. One of them asked his brother to divide it, but the other replied, "If you ask me again to divide it, I will never speak to you again, and all my wealth shall be devoted to the door of the Kaabah."Umar bin Khattab said to him, "The Kaabah has no need of your wealth. Make expiation for your oath and speak to your brother. For I heard the Messenger of Allah ﷺ say, 'No oath binds you, nor any vow, when it involves disobedience to Allah, severing ties of kinship, or something you do not own.'"
أن أخوين من الأنصار كان بينهما ميراث. فسأل أحدهما صاحبه القسمة، فقال: لئن عدت تسألني القسمة لن أكلمك أبدا. وكل مال لي في رتاج الكعبة. فقال عمر بن الخطاب: إن الكعبة لغنية عن مالك. كفر عن يمينك، وكلم أخاك. فإني سمعت رسول الله ﷺ يقول: لا يمين عليك، ولا نذر في معصية، ولا في قطيعة رحم، ولا فيما لا تملك.
Abu Dawud (3272), Ibn Hibban (4355), Hakim (4/300), and Bayhaqi (10/33) all narrated it through the route of Yazid bin Zuray, who said, "Habib al-Muallim narrated to us, from Amr bin Shuayb, from Saeed bin Musayab," and he mentioned it. Hakim said, "Its isnad is sahih." I say, its isnad is hasan because of Amr bin Shuayb, for his hadith is hasan.And from Ayesha, that she said, "Whoever says, 'My wealth is committed to the door of the Kaaba,' its expiation is only that of an oath." Malik narrated it in the chapter on Vows and Oaths (20), from Ayub bin Musa, from Mansur bin Abdul-Rahman al-Hijabi, from his mother, from Ayesha, who mentioned it.The original meaning of "ritaj" is "the door." Whoever says this does not mean the door itself, but rather means that his wealth should become an offering to the Kaaba, to be placed there wherever he intended and wished. He is only bound by the expiation of an oath if he made this commitment out of anger.See Sharh al-Sunnah (10/36).