I heard Kaab bin Malik say in his account regarding the verse "And to the three who were left behind" [Tawba 9:118], at the end of his account, "Part of my repentance is that I give up all my wealth as charity to Allah and His Messenger."The Prophet ﷺ said, "Keep some of your wealth for yourself, that is better for you."
سمعت كعب بن مالك في حديثه{وعلى الثلثة الذين خلفوا} [التوبة: ١١٨] فقال في آخر حديثه: إن من توبتي أني أنخلع من مالي صدقة إلى الله ورسوله. فقال النبي ﷺ: أمسك عليك بعض مالك فهو خير لك.
Bukhari narrated it in the Book of Oaths (6690), and Muslim in the Book of Repentance (2769) at length, both of them from the hadith of Ibn Wahb, who said, Yunus told me, from Ibn Shihab, who said, Abdul-Rahman bin Abdullah bin Kaab bin Malik told me, and so on, and he related it.