Sahih al-Bukhari 6757
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
لاَ يَمْنَعُكِ ذَلِكِ، فَإِنَّمَا الْوَلاَءُ لِمَنْ أَعْتَقَ "
Narrated Ibn `Umar:
That Aisha, the mother of the Believers, intended to buy a slave girl in order to manumit her. The slave girl's master said, "We are ready to sell her to you on the condition that her Wala should be for us." Aisha mentioned that to Allah's Messenger (ﷺ) who said, "This (condition) should not prevent you from buying her, for the Wala is for the one who manumits (the slave)."
Full reference and source
Sahih al-Bukhari 6757 In-book : Book 85, Hadith 34 USC-MSA web (English) : Vol. 8, Book 80, Hadith 749 (deprecated)
View source on Sunnah.com (opens in a new tab)