Language:
كتاب الزكاة
24  
Obligatory Charity Tax (Zakat)
(15)
Chapter: If a person gives something in charity to his own son unknowingly
(15)
باب إِذَا تَصَدَّقَ عَلَى ابْنِهِ وَهُوَ لاَ يَشْعُرُ
Sahih al-Bukhari 1422

Narrated Ma'n bin Yazid:

My grandfather, my father and I gave the pledge of allegiance to Allah's Messenger (ﷺ). The Prophet (ﷺ) got me engaged and then got me married. One day I went to the Prophet (ﷺ) with a complaint. My father Yazid had taken some gold coins for charity and kept them with a man in the mosque (to give them to the poor) But I went and took them and brought them to him (my father). My father said, "By Allah! I did not intend to give them to you. " I took (the case) to Allah's Messenger (ﷺ) . On that Allah's Messenger (ﷺ) said, "O Yazid, you will be rewarded for what you intended. O Ma'n, whatever you have taken is yours."

حَدَّثَنَا مُحَمَّدُ بْنُ يُوسُفَ، حَدَّثَنَا إِسْرَائِيلُ، حَدَّثَنَا أَبُو الْجُوَيْرِيَةِ، أَنَّ مَعْنَ بْنَ يَزِيدَ ـ رضى الله عنه ـ حَدَّثَهُ قَالَ بَايَعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم أَنَا وَأَبِي وَجَدِّي وَخَطَبَ عَلَىَّ فَأَنْكَحَنِي وَخَاصَمْتُ إِلَيْهِ ـ وَـ كَانَ أَبِي يَزِيدُ أَخْرَجَ دَنَانِيرَ يَتَصَدَّقُ بِهَا فَوَضَعَهَا عِنْدَ رَجُلٍ فِي الْمَسْجِدِ، فَجِئْتُ فَأَخَذْتُهَا فَأَتَيْتُهُ بِهَا فَقَالَ وَاللَّهِ مَا إِيَّاكَ أَرَدْتُ‏.‏ فَخَاصَمْتُهُ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ ‏ "‏ لَكَ مَا نَوَيْتَ يَا يَزِيدُ، وَلَكَ مَا أَخَذْتَ يَا مَعْنُ ‏"‏‏.‏
Reference : Sahih al-Bukhari 1422
In-book reference : Book 24, Hadith 26
USC-MSA web (English) reference : Vol. 2, Book 24, Hadith 503
  (deprecated numbering scheme)