Sayyiduna Ma'qil bin Yasar (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Whoever buys a slave in order to free him, let him not stipulate the freeing for the slave's owners, for the very contract of this purchase is one of ending slavery."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 17657