Language:
كتاب الشروط
54  
Conditions
(3)
Chapter: The conditions of selling
(3)
باب الشُّرُوطِ فِي الْبَيْعِ
Sahih al-Bukhari 2717

Narrated `Urwa:

Aisha told me that Barirah came to seek her help in writing for emancipation and at that time she had not paid any part of her price. `Aisha said to her, "Go to your masters and if they agree that I will pay your price (and free you) on condition that your Wala' will be for me, I will pay the money." Barirah told her masters about that, but they refused, and said, "If `Aisha wants to do a favor she could, but your Wala will be for us." Aisha informed Allah's Messenger (ﷺ) of that and he said to her, "Buy and manumit Barirah as the Wala' will go to the manumitted."

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