The Messenger of Allah ﷺ said, "Whoever amasses wealth through unlawful means and then gives it away in charity will receive no reward for it, and its burden of sin will remain upon him."
قال رسول الله ﷺ: من جمع مالا حراما ثم تصدق به لم يكن له فيه أجر، وكان إصره عليه.
No references are available.
Ibn Hibban (3367) narrated it from Ibn Salm, who said, Harmala bin Yahya narrated to us, Ibn Wahb narrated to us, he said, I heard Amr bin Harith say, Darraj Abu Samh narrated to me, from Ibn Hujayra, from Abu Hurairah, and he related it.Its chain is hasan because of the discussion surrounding Darraj Abu Samh, except that his hadith is hasan when it is not from Abu Haytham. Ibn Hujayra is Abdul-Rahman bin Hujayra, with the diminutive form, the Egyptian judge, a trustworthy narrator among the men of Muslim.His saying, "its burden falls upon him," the burden means the sin and the punishment.