The Prophet ﷺ said, "Whoever comes to own a close relative within the prohibited degrees of kinship, that relative is automatically free."
حدثنا عقبة بن مكرم وإسحق بن منصور قالا حدثنا محمد بن بكر البرساني عن حماد بن سلمة عن قتادة وعاصم عن الحسن
عن النبي ﷺ قال من ملك ذا رحم محرم فهو حر
[Hasan] Tirmidhi transmitted it, Ahkam, chapter on whoever owns a relative within the prohibited degrees, h: 1365, from Uqba bin Mukram, with this wording. Ibn Jarud graded it sahih, h: 973, as did Hakim, 2/214, and Dhahabi, as mentioned in Nayl Maqsud, h: 3949. See also h: 2183.