It was narrated from Abu Hurairah that a man asked the Messenger of Allah (ﷺ): “My father died and left behind wealth, but he did not make a will. Will it expiate for him if I give charity on his behalf?” He said: “Yes.”
It was narrated from Aishah that a man came to the Prophet (ﷺ) and said: “My mother died unexpectedly and she had not made a will. I think that if she could have spoken, she would have given in charity. Will she have a reward if I give in charity on her behalf, and will I have a reward?” He said: “Yes.”