It is narrated from Buraidah Al-Aslami (may Allah be pleased with him) that a man asked the Prophet (ﷺ): "I gave a slave in charity on behalf of my mother, and now she has passed away." The Messenger of Allah (ﷺ) said: "Your charity has become obligatory, and it is your inheritance."
Hadith Referenceمسند الإمام الشافعي / كتاب صدقة التطوع والهبة وصلة الوالد والأخ المشرك / 1051
Hadith Takhrijصحيح من غير هذا الطريق: اخرجه مسلم، الصيام، باب قضاء الصوم عن الميت (1149)۔