It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that a man freed a slave of his, then the freed slave died, so the Prophet (peace and blessings be upon him) made the one who had freed him his heir.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11149