A man died leaving no heir except a slave whom he had freed. The Messenger of Allah ﷺ asked, "Does he have anyone?"They said, "No one except a slave he had freed."So the Messenger of Allah ﷺ gave his inheritance to him.
حدثنا موسى بن إسمعيل حدثنا حماد أخبرنا عمرو بن دينار عن عوسجة
أن رجلا مات ولم يدع وارثا إلا غلاما له كان أعتقه فقال رسول الله ﷺ هل له أحد قالوا لا إلا غلاما له كان أعتقه فجعل رسول الله ﷺ ميراثه له
Sourcing, its chain is hasan. Tirmidhi transmitted it in the chapters on inheritance, chapter on the inheritance of the freed slave from below, hadith 2106, and Ibn Majah, hadith 2741, from the hadith of Amr bin Dinar, with this wording. Tirmidhi said, "Hasan." Awsajah's hadith is hasan according to the correct view.