It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that a man from among the Bedouins died and he had no asabah (relatives on the father's side), but he had a mawla (freed slave) whom he had set free. This matter was brought before the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) said: "Did he (the mawla) not used to become angry at his anger and be pleased at his pleasure?" The people said: "Yes, indeed!" So he (peace and blessings be upon him) made him inherit the property of the one who had freed him.
Abu Hamzah's name is Muhammad bin Maymun al-Sukkari al-Marwazi (may Allah have mercy on him); Imam al-Bukhari and Imam Muslim (may Allah have mercy on them both) narrated from him.
Related hadith on this topic