Ayesha reported,

The Messenger of Allah ﷺ came in to see me, so I mentioned the matter to him. The Messenger of Allah ﷺ said, "Buy her and free her, for the right of inheritance through clientage belongs only to the one who frees the slave."Then the Prophet ﷺ stood up that evening, praised Allah as He deserves to be praised, and said, "What is the matter with people who stipulate conditions not found in the Book of Allah? Whoever stipulates a condition not found in the Book of Allah, it is invalid, even if he stipulates a hundred conditions. The condition of Allah is more deserving and more binding."

Bukhari 2155

Sahih

حدثنا أبو اليمان أخبرنا شعيب عن الزهري قال عروة بن الزبير قالت

عائشة رضي الله عنها

دخل علي رسول الله ﷺ فذكرت له فقال رسول الله ﷺ اشتري وأعتقي فإنما الولاء لمن أعتق ثم قام النبي ﷺ من العشي فأثنى على الله بما هو أهله ثم قال ما بال أناس يشترطون شروطا ليس في كتاب الله من اشترط شرطا ليس في كتاب الله فهو باطل وإن اشترط مائة شرط شرط الله أحق وأوثق

البخاري 2155صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Sales
Chapter
Buying and selling with women
Numbering
Darussalam 2155
Bukhari 2155