It is narrated from ‘Amrah bint ‘Abd al-Rahman that Barirah (may Allah be pleased with her) came seeking help, so ‘A’ishah (may Allah be pleased with her) said: “If your masters are pleased that I pay your price to them in one lump sum and set you free, I will do so.” Barirah (may Allah be pleased with her) conveyed this to her masters, but they said: “No, except that your wala’ (allegiance) will be for us.” Imam Malik (may Allah have mercy on him) said that Yahya said: ‘Amrah thinks that ‘A’ishah (may Allah be pleased with her) mentioned this to the Messenger of Allah (ﷺ), so he (ﷺ) said: “Do not let this (condition) prevent you (from freeing her). Buy her and set her free, for the wala’ is for the one who sets free.”
Hadith Referenceمسند الإمام الشافعي / كتاب العتق والولاء والمدبر والمكاتب وحسن الملكة / 1081
Hadith Takhrijاخرجه البخارى المكاتب باب بيع المكاتب اذا رضي (2564)۔