Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: A Bedouin man died who had no 'asabah (male agnatic heirs), but he had a slave whom he had freed. The matter was brought before the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) said: "Was he not angered by what angered him and pleased by what pleased him?" The people said: Yes, indeed. So he (peace and blessings be upon him) made him the heir of his master's wealth.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11875