The Messenger of Allah ﷺ forbade the sale of the right of patronage and its gift.
حدثنا ابن أبي عمر حدثنا سفيان بن عيينة حدثنا عبد الله بن دينار
أن رسول الله ﷺ نهى عن بيع الولاء وعن هبته
Agreed upon (by Bukhari and Muslim). Bukhari narrated it in the Book of Inheritance, chapter on the sin of one who disowns his freedmen, no. 6756, and Muslim, no. 1506, from the hadith of Sufyan bin Uyayna, through the same chain.