Fiqh-us-Sunnah Volume 3, Zakaat and Fasting, Fiqh 3.104A.

Section : Perpetual sadaqah.

The perpetual sadaqah (sadaqat ul-jariyah): Ahmad and Muslim relate that the Messenger of Allah, upon whom be peace, said: “When a person dies [the benefit] of his deeds ends, except three: a continuous sadaqah, knowledge from which benefit is derived, or a pious child invoking Allah for him.”