The Messenger of Allah ﷺ said, "Whoever frees his share of a jointly owned slave, and he has enough wealth to cover the slave's full value, then the slave is to be fully freed using his wealth."
أخبرنا عمرو بن علي قال حدثنا يزيد وهو ابن زريع قال حدثنا أيوب عن نافع
قال رسول الله ﷺ من أعتق شركا له في مملوك وكان له من المال ما يبلغ ثمنه بقيمة العبد فهو عتيق من ماله
Bukhari narrated it, book of Partnership, chapter on the valuation of items shared between partners at a fair price, no. 2491, and Muslim, no. 1501, see the previous hadith, from the hadith of Ayub Sakhtiyani through him, and it is in Kubra, no. 6298.