Sahih al-Bukhari, Volume 3, Book 46, Hadith 697 (USC-MSA) ⓘ
Narrated Ibn `Umar: The Prophet said, "Whoever manumits a slave owned by two masters, should manumit him completely (not partially) if he is rich after having its price evaluated."
حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ اللَّهِ، حَدَّثَنَا سُفْيَانُ، عَنْ عَمْرٍو، عَنْ سَالِمٍ، عَنْ أَبِيهِ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " مَنْ أَعْتَقَ عَبْدًا بَيْنَ اثْنَيْنِ، فَإِنْ كَانَ مُوسِرًا قُوِّمَ عَلَيْهِ ثُمَّ يُعْتَقُ " .
also referenced under: Book 49, Hadith 5 (In-Book) & Hadith 2521 (DarusSalam)