(V.11:113) The sin of the person who gives refuge or helps a person who innovates a heresy (in the religion) or commits sins. This has been narrated by ‘Ali رضي الله عنه on the authority of the Prophet صلى الله عليه وسلم.
Narrated ‘Âsim: I said to Anas, "Did Allâh’s Messenger صلى الله عليه وسلم make Al-Madinah a sanctuary?" He replied, "Yes, Al-Madinah is a sanctuary from such and such place to such and such place. It is forbidden to cut its trees, and whoever innovates a heresy in it or commits a sin therein, will incur the Curse of Allâh, the angels, and all the people," Then Mûsâ bin Anas told me that Anas added, "... or gives refuge to such a heretic or a sinner ..."
(Sahih Al-Bukhari, Vol.9, Hadith No.409).