Sahih al-Bukhari, Book 85, Hadith 23 (In-Book)

Narrated Ibn `Abbas: The Prophet said, "Give the Fara'id (the shares of the inheritance that are prescribed in the Qur'an) to those who are entitled to receive it; and whatever is left should be given to the closest male relative of the deceased."

حَدَّثَنَا أُمَيَّةُ بْنُ بِسْطَامٍ، حَدَّثَنَا يَزِيدُ بْنُ زُرَيْعٍ، عَنْ رَوْحٍ، عَنْ عَبْدِ اللَّهِ بْنِ طَاوُسٍ، عَنْ أَبِيهِ، عَنِ ابْنِ عَبَّاسٍ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ أَلْحِقُوا الْفَرَائِضَ بِأَهْلِهَا، فَمَا تَرَكَتِ الْفَرَائِضُ فَلأَوْلَى رَجُلٍ ذَكَرٍ ‏" ‏‏.‏

sunnah.com