Language:
كتاب الوصايا
55  
Wills and Testaments (Wasaayaa)
(7)
Chapter: Giving in charity at the time of death
(7)
باب الصَّدَقَةِ عِنْدَ الْمَوْتِ
Sahih al-Bukhari 2748

Narrated Abu Huraira:

A man asked the Prophet, "O Allah's Messenger (ﷺ)! What kind of charity is the best?" He replied. "To give in charity when you are healthy and greedy hoping to be wealthy and afraid of becoming poor. Don't delay giving in charity till the time when you are on the death bed when you say, 'Give so much to soand- so and so much to so-and so,' and at that time the property is not yours but it belongs to so-and-so (i.e. your inheritors).

حَدَّثَنَا مُحَمَّدُ بْنُ الْعَلاَءِ، حَدَّثَنَا أَبُو أُسَامَةَ، عَنْ سُفْيَانَ، عَنْ عُمَارَةَ، عَنْ أَبِي زُرْعَةَ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ قَالَ قَالَ رَجُلٌ لِلنَّبِيِّ صلى الله عليه وسلم يَا رَسُولَ اللَّهِ، أَىُّ الصَّدَقَةِ أَفْضَلُ قَالَ ‏ "‏ أَنْ تَصَدَّقَ وَأَنْتَ صَحِيحٌ حَرِيصٌ‏.‏ تَأْمُلُ الْغِنَى، وَتَخْشَى الْفَقْرَ، وَلاَ تُمْهِلْ حَتَّى إِذَا بَلَغَتِ الْحُلْقُومَ قُلْتَ لِفُلاَنٍ كَذَا وَلِفُلاَنٍ كَذَا، وَقَدْ كَانَ لِفُلاَنٍ ‏"‏‏.‏
Reference : Sahih al-Bukhari 2748
In-book reference : Book 55, Hadith 11
USC-MSA web (English) reference : Vol. 4, Book 51, Hadith 11
  (deprecated numbering scheme)