Sahih al-Bukhari Book 49, Hadith 19
Allah's Messenger (ﷺ) forbade the selling or donating the Wala' of a freed slave.
A man amongst us declared that his slave would be freed after his death. The Prophet (ﷺ) called for that slave and sold him. The slave died the same year.
I bought Barirah but her masters put the condition that her Wala' would be for them. I told the Prophet (ﷺ) about it. He said (to me), "Manumit (free) her as her Wala' will be for the one who pays the price." So, I manumitted (freed) her. The Prophet (ﷺ) called Barirah and gave her the option of either staying with her husband or leaving him. She said, "Even if he gave me so much money, I would not stay with him," and so she preferred her freedom to her husband.