Ayesha reported,

Aishah wanted to buy Barirah, but the sellers stipulated that the right of inheritance through emancipation would remain with them. She mentioned this to the Prophet ﷺ, who said, "Buy her, for the right of inheritance through emancipation belongs only to the one who frees the slave."

Bukhari 6717

Sahih

حدثنا سليمان بن حرب حدثنا شعبة عن الحكم عن إبراهيم عن الأسود

عن عائشة

أنها أرادت أن تشتري بريرة فاشترطوا عليها الولاء فذكرت ذلك للنبي ﷺ فقال اشتريها فإنما الولاء لمن أعتق

البخاري 6717صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expiations for oaths
Chapter
If a slave is freed as expiation, to whom does the wala belong
Numbering
Darussalam 6717
Bukhari 6717