Sunan Ibn Majah, Book 23, Hadith 15 (Ibn Majah 2735)

It was narrated from ‘Aishah that the freed slave of the Prophet (ﷺ) fell from a palm tree and died. He left behind wealth but he had no child or close relative. The Prophet (ﷺ) said:

“Give his legacy to a man from his village.”