It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that a man died and did not leave anyone who would inherit from him, so the Prophet (peace and blessings be upon him) gave his inheritance to a freed slave of his whom the deceased had set free; he was the one who had the right of wala' (clientage) over him, and he was the one who had set him free.
Related hadith on this topic