Saad bin Ubada went out with the Prophet ﷺ on one of his military expeditions, and his mother was on the verge of death in Medina. She was told, "Make a will."She replied, "What should I bequeath? The wealth belongs to Saad."She passed away before Saad returned. When Saad came back, he was informed of this and asked, "Messenger of Allah, will it benefit her if I give charity on her behalf?"The Prophet ﷺ answered, "Yes."So Saad said, "Such-and-such garden is a charity on her behalf," naming a particular garden.
أنبأنا الحارث بن مسكين قراءة عليه وأنا أسمع عن ابن القاسم عن مالك
خرج سعد بن عبادة مع النبي ﷺ في بعض مغازيه وحضرت أمه الوفاة بالمدينة فقيل لها أوصي فقالت فيم أوصي المال مال سعد فتوفيت قبل أن يقدم سعد فلما قدم سعد ذكر ذلك له فقال يا رسول الله هل ينفعها أن أتصدق عنها فقال النبي ﷺ نعم فقال سعد حائط كذا وكذا صدقة عنها لحائط سماه
[Its chain of transmission is sahih] Ibn Khuzayma reported it in his Sahih, no. 2500, from the hadith of Malik through him, and it is found in Muwatta (Yahya) 2/760, and in Kubra, no. 6477, and Ibn Hibban graded it sahih, no. 857, and the hadith has many corroborating narrations.