Sahih al-Bukhari, Volume 3, Book 34, Hadith 365 (USC-MSA)

Narrated `Abdullah bin `Umar: Aisha wanted to buy Buraira and he (the Prophet ) went out for the prayer. When he returned, she told him that they (her masters) refused to sell her except on the condition that her Wala' would go to them. The Prophet replied, 'The Wala' would go to him who manumits.' " Hammam asked Nafi` whether her (Buraira's) husband was a free man or a slave. He replied that he did not know.

حَدَّثَنَا حَسَّانُ بْنُ أَبِي عَبَّادٍ، حَدَّثَنَا هَمَّامٌ، قَالَ سَمِعْتُ نَافِعًا، يُحَدِّثُ عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ ـ رضى الله عنهما أَنَّ عَائِشَةَ ـ رضى الله عنها ـ سَاوَمَتْ بَرِيرَةَ فَخَرَجَ إِلَى الصَّلاَةِ، فَلَمَّا جَاءَ قَالَتْ إِنَّهُمْ أَبَوْا أَنْ يَبِيعُوهَا، إِلاَّ أَنْ يَشْتَرِطُوا الْوَلاَءَ‏.‏ فَقَالَ النَّبِيُّ صلى الله عليه وسلم ‏ "‏ إِنَّمَا الْوَلاَءُ لِمَنْ أَعْتَقَ ‏" ‏‏.‏ قُلْتُ لِنَافِعٍ حُرًّا كَانَ زَوْجُهَا أَوْ عَبْدًا فَقَالَ مَا يُدْرِينِي

sunnah.com