Abdullah bin Ka'b bin Malik (may Allah be pleased with him) narrates from his father that he said to the Messenger of Allah (peace and blessings be upon him), when his repentance was accepted: "O Messenger of Allah, I want to give my wealth in charity." The Messenger of Allah (peace and blessings be upon him) said: "Keep some of your wealth; that is better for you."
This hadith is sahih (authentic), while the first one is disputed in its chain, is not established as connected (mawsul), and it is not valid to use it as evidence in this matter. Abu Lubabah (may Allah be pleased with him) wanted to give his wealth in the way of Allah out of gratitude to Allah, so just as he (peace and blessings be upon him) had stopped Ka'b bin Malik (may Allah be pleased with him) from giving all his wealth, he stopped Abu Lubabah (may Allah be pleased with him) as well. It has not reached us that he made a vow or swore an oath.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 20053