Mishkat al-Masabih
Ibn ‘Abbas said that a man died leaving no heir but a youth whom he had emancipated, and that when the Prophet (ﷺ) asked whether he had any heir and was told that he had none but a youth of his whom he had emancipated, he assigned his estate to him. Abu Dawud, Tirmidhi and Ibn Majah transmitted it.
وَعَنِ ابْنِ عَبَّاسٍ: أَنَّ رَجُلًا مَاتَ وَلَمْ يَدَعْ وَارِثًا إِلَّا غُلَامًا كَانَ أَعْتَقَهُ فَقَالَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «هَلْ لَهُ أَحَدٌ؟» قَالُوا: لَا إِلَّا غُلَامٌ لَهُ كَانَ أَعْتَقَهُ فَجَعَلَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ مِيرَاثَهُ لَهُ. رَوَاهُ أَبُو دَاوُدَ وَالتِّرْمِذِيُّ وَابْنُ مَاجَه
Reference