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 she has now died."He replied, "Your reward is confirmed, and the inheritance has returned the Jariya to you."She asked, "Messenger of Allah, she owed a month of fasting. Shall I fast on her behalf?"He said, "Fast on her behalf."She asked, "She never performed the pilgrimage. Shall I perform it on her behalf?"He said, "Perform the pilgrimage on her behalf."In another narration, the fast owed was two months.

Azami 4625

Sahih

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

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

الأعظمي 4625صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
What is permitted and what is not permitted for the fasting person
Section
Fulfilling fasting on behalf of the deceased
Numbering
Jami al-Kamil 4625 (2nd edition)
Azami 4625