Language:
كتاب البيوع
34  
Sales and Trade
(73)
Chapter: If somebody imposes conditions in selling against the Islamic Law
(73)
باب إِذَا اشْتَرَطَ شُرُوطًا فِي الْبَيْعِ لاَ تَحِلُّ
Sahih al-Bukhari 2169

Narrated `Abdullah bin `Umar:

Aisha, (mother of the faithful believers) wanted to buy a slave girl and manumit her, but her masters said that they would sell her only on the condition that her Wala' would be for them. `Aisha told Allah's Messenger (ﷺ) of that. He said, "What they stipulate should not hinder you from buying her, as the Wala' is for the manumitted."

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ يُوسُفَ، أَخْبَرَنَا مَالِكٌ، عَنْ نَافِعٍ، عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ ـ رضى الله عنهما ـ أَنَّ عَائِشَةَ، أُمَّ الْمُؤْمِنِينَ أَرَادَتْ أَنْ تَشْتَرِيَ جَارِيَةً فَتُعْتِقَهَا، فَقَالَ أَهْلُهَا نَبِيعُكِهَا عَلَى أَنَّ وَلاَءَهَا لَنَا‏.‏ فَذَكَرَتْ ذَلِكَ لِرَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ ‏ "‏ لاَ يَمْنَعُكِ ذَلِكَ، فَإِنَّمَا الْوَلاَءُ لِمَنْ أَعْتَقَ ‏"‏‏.‏
Reference : Sahih al-Bukhari 2169
In-book reference : Book 34, Hadith 120
USC-MSA web (English) reference : Vol. 3, Book 34, Hadith 378
  (deprecated numbering scheme)