From Sahih Bukhari (Hadith 6717):
Narrated `Aisha:that she intended to buy Barira (a slave girl) and her masters stipulated that they would have her Wala'. When `Aisha mentioned that to the Prophet (ﷺ) ; he said, "Buy her, for the Wala' is for the one who manumits
Reference: Bukhari 6717