A woman came to the Messenger of Allah (peace and blessings be upon him) and said: "O Messenger of Allah! I had given a slave girl in charity to my mother, and she has died and left the slave girl behind?" He (peace and blessings be upon him) said: "Your reward is secured, and she has returned to you as inheritance." She said: "She has died while she owed fasts; will it suffice if I fast on her behalf?" He (peace and blessings be upon him) said: "Yes!" She said: "She also did not perform Hajj; will it suffice if I perform Hajj on her behalf?" He (peace and blessings be upon him) said: "Yes."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 8670