Hasan al-Basri (may Allah have mercy on him) said: "If someone gives charity and then that wealth comes to him through inheritance, then there is no harm in it, but they considered it disliked to buy it."
Hadith Referenceسنن سعید بن منصور / كتاب ولاية العصبة / 1427
Hadith Takhrij«أخرجه سعيد بن منصور فى «سننه» ترقيم الدرالسلفية برقم:، 250، وابن أبى شيبة فى «مصنفه» برقم: 21402»