Sahih Muslim Book 9, Hadith Number 3598.

Chapter: It is forbidden for a slave to take anyone as his ally except one who emancipates him.

Jabir b. Abdullah (Allah be pleased with them) reported that Allah’s Apostle (may peace be upon him) made it obligatory for every tribe (the payment) of blood-wit; he then also made it explicit that it is not permissible for a Muslim to make himself the ally (of the slave emancipated by another) Muslim without his permission. He (the narrator further added): I was informed that he (the Holy Prophet) cursed the one who did that (and it was recorded) in his Sahifa (in a document).