The Messenger of Allah ﷺ said, "Whoever frees his share in a jointly owned slave, if he has enough wealth to cover the slave's full price, the slave is to be valued at a fair price, the partners are to be paid their shares, and the slave is freed by him. Otherwise, only the portion he has freed is freed."
أن رسول ﷺ قال: من أعتق شركا له في عبد، فكان له مال يبلغ ثمن العبد قوم عليه قيمة العدل، فأعطى شركاءه حصصهم، وعتق عليه العبد، وإلا فقد عتق منه ما عتق.
Malik narrated it in Manumission and Clientage (1) from Nafi, from Abdullah bin Umar, as mentioned.Bukhari narrated it in Manumission (2522), and Muslim in Manumission (1501:1) and in Oaths and Vows (1501:47), both of them through the route of Malik, in like manner.