Abu Hurairah (RA) reported that Allah's Messenger (ﷺ) said: He who takes anyone as his ally without the consent of his previous master, there will be the curse of Allah and that of His angels upon him, and neither, any obligatory act of his nor the supererogatory one will be accepted (by Allah).
Abu Hurairah (RA) reported Allah's Apostle (ﷺ) as saying: He (the freed slave) who took (other) people as his allies without the consent of his previous masters, there is upon him the curse of Allah and that of His angels and that of the whole mankind, and there will not be accepted from him his obligatory acts or supererogatory acts on the Day of Resurrection.