Sayyiduna Abu Hurayrah (may Allah be pleased with him) says that the Messenger of Allah (peace and blessings be upon him) said: "They (the imams) lead you in prayer. If they get it right, there is reward for you and for them; and if they err, there is reward for you and the burden is on them."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5330