Abu Dawud Book 11, Hadith Number 2871.
Chapter : On a man who donates a thing then it is bequethed to him or he inherits it.
Narated By Buraidah : A woman came to the Apostle of Allah (PBUH) and said: I donated my slave-girl to my mother, but she died and left the slave-girl. He said: Your reward became due, and she came back to you in inheritance. She said: She died while a month’s fasting was due from her. Would it be sufficient or be taken as completed if I fast on her behalf? He said: Yes. She said: She also did not perform Hajj. Would it be sufficient or be taken as completed if I perform (hajj) on her behalf? He said: Yes.