The Messenger of Allah ﷺ said, "Whoever comes to own a close relative within the prohibited degrees of kinship, that relative is automatically freed."
حدثنا عبد الله بن معاوية الجمحي البصري حدثنا حماد بن سلمة عن قتادة عن الحسن
أن رسول الله ﷺ قال من ملك ذا رحم محرم فهو حر
[Hasan]. Abu Dawud also reported it in the Book of Manumission, chapter on one who owns a relative within the prohibited degree, no. 3949, and Ibn Majah, no. 2524, from the hadith of Hammad bin Salama with this wording. Hakim graded it sahih at 2/214, as did Dhahabi, and Ibn Jarud, no. 973.The hadith of Uqba bin Mukram was reported by Ibn Majah, no. 2524, from him, and its chain is hasan.