It wasnarrated that Ibn 'Abbas said:
"A man died at the time of theMessenger of Allah (ﷺ), and he left no heir except for a slave whomhe had set free. The Messenger of Allah (ﷺ) gave the legacy tohim." (JA)
English reference (JA): Vol. 4, Book 23, Hadith 2741 (JA)
Arabic reference (JA): Book 23, Hadith 2846 (JA)