Sayyiduna Ibn Abbas (may Allah be pleased with them both) narrates: A man died in the time of the Prophet (peace and blessings be upon him), and he left no heir except a slave of his, so the Prophet (peace and blessings be upon him) set him free and gave him his inheritance.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12158