Barirah came to Ayesha seeking her help, as she was a slave who had contracted with her owners to buy her freedom.Ayesha said to her, "Will your owners sell you?"Barirah went to her owners and mentioned this to them. They replied, "Only on the condition that her right of inheritance (wala) remains with us."The Prophet ﷺ said, "Buy her and free her, for the right of inheritance belongs only to the one who frees the slave."
حدثنا عبد الأعلى عن معمر عن الزهري عن عروة
أن بريرة أتتها تستعينها وكانت مكاتبة فقالت لها عائشة أيبيعك أهلك فأتت أهلها فذكرت ذلك لهم فقالوا لا إلا أن تشترط لنا ولاءها فقال النبي ﷺ اشتريها فأعتقيها فإنما الولاء لمن أعتق
Its isnad is sahih, and it is found in Bukhari 5/167 no. 2536, Muslim 2/1141 no. 1504, and Abu Dawud 4/21 no. 3929, all in the chapter on emancipation, and Tirmidhi 4/436 no. 2124 in the chapter on bequests, and Nasai 7/305 no. 4655 in the chapter on sales.