The Messenger of Allah ﷺ said, "Whoever frees his share in a jointly owned slave, if he has wealth sufficient to cover the slave's value, the slave shall be appraised at a fair price, his partners shall be paid their shares, and the slave shall be freed entirely on his account. Otherwise, only the portion he freed is freed."
حدثنا يحيى بن يحيى قال قلت لمالك حدثك نافع
قال رسول الله ﷺ من أعتق شركا له في عبد فكان له مال يبلغ ثمن العبد قوم عليه قيمة العدل فأعطى شركاءه حصصهم وعتق عليه العبد وإلا فقد عتق منه ما عتق