It is narrated from Sayyiduna Abu Musa al-Ash'ari (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "The example of a righteous companion is like that of a perfume-seller: even if he gives you none of his perfume, its fragrance will keep reaching you. And the example of a bad companion is like that of a blacksmith: even if he does not burn your clothes, the smell of his smoke will keep reaching you."
Al-Tabarani recorded it, and its chain is hasan (good).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الأدب / 12931