a man died during the time of the Messenger of Allah ﷺ ,and he did not leave any heirs except for a slave that he had freed. So the Prophet gave him his inheritance
أَنَّ رَجُلاً مَاتَ عَلَى عَهْدِ رَسُولِ اللَّهِ ﷺ وَلَمْ يَدَعْ وَارِثًا إِلاَّ عَبْدًا هُوَ أَعْتَقَهُ فَأَعْطَاهُ النَّبِيُّ ﷺ مِيرَاثَهُ