Burayda reported,

While I was sitting with the Messenger of Allah ﷺ, a woman came to him and said, "I gave my mother a slave-girl as charity, and now she has died."He replied, "Your reward is confirmed, and the inheritance has returned the slave-girl to you."She asked, "Messenger of Allah, she owed a month's fast. Shall I fast on her behalf?"He answered, "Fast on her behalf."She said, "She never performed the pilgrimage. Shall I perform the pilgrimage on her behalf?"He answered, "Perform the pilgrimage on her behalf."

Muslim 2697

Sahih

و حدثني علي بن حجر السعدي حدثنا علي بن مسهر أبو الحسن عن عبد الله بن عطاء

عن عبد الله بن بريدة عن أبيه رضي الله عنه قال

بينا أنا جالس عند رسول الله ﷺ إذ أتته امرأة فقالت إني تصدقت على أمي بجارية وإنها ماتت قال فقال وجب أجرك وردها عليك الميراث قالت يا رسول الله إنه كان عليها صوم شهر أفأصوم عنها قال صومي عنها قالت إنها لم تحج قط أفأحج عنها قال حجي عنها

مسلم 2697صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Fasting
Chapter
Fulfilling fasting on behalf of the deceased
Numbering
Darussalam 2697
Muslim 2697