From Sahih Muslim (Hadith 4330):
Ibn 'Umar reported Allah's Apostle (ﷺ) as saying:He who gives up his share in a slave, the remaining (share) will be paid out of his riches if his riches are enough to meet the price of the slave
Reference: Muslim 4330