Imam al-Shafi'i (may Allah have mercy on him) said: "This is neither enmity nor backbiting, when he says it to someone about whom he fears that he will follow him and fall into error by following him; and this is among the meanings of testimonies."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / Q20910