The Messenger of Allah ﷺ forbade the sale of the right of patronage and its gifting.
حدثنا محمد بن عبد الملك بن أبي الشوارب حدثنا يحيى بن سليم الطائفي عن عبيد الله بن عمر عن نافع
نهى رسول الله ﷺ عن بيع الولاء وعن هبته
[Sahih] Tirmidhi transmitted it in Sunan Tirmidhi, Sales, chapter on what has been said regarding the disapproval of selling and gifting the right of inheritance from freeing a slave, hadith no. 1236, from the hadith of Yahya bin Salim, mentioning it as a suspended chain (muallaq), and he said, "This is a mistake, and the one who made the mistake in it is Yahya bin Salim," meaning that it should be from the narration of Abdullah bin Dinar from Ibn Umar with this wording, and he said, "This is the more sahih chain," and he gave it preference.