Qatadah (may Allah have mercy on him) said: When two mukatabs buy each other, this one from his owner and that one from his owner, then (in such a case) the sale of the one who bought first will be considered valid (and the sale of the other will be void), and the people of Madinah say that the right of wala’ (inheritance) will belong to the selling owner. They say: The one who bought has purchased that which was obligatory upon the mukatab to pay, therefore the wala’ will belong to the owner.
Hadith Referenceسنن دارمي / من كتاب الفرائض / 3167
Hadith Gradingتحقیق (حسین سلیم أسد الدارانی):إسناده صحيح إلى قتادة، [مكتبه الشامله نمبر: 3176]
Hadith Takhrijاس اثر کی سند قتادہ رحمہ اللہ تک صحیح ہے۔ اور ابوسفیان کا نام محمد بن حمید المعمری الیشکری ہے۔ دیکھئے: [عبدالرزاق 15810]
Brief Explanation
(Commentary on Ahadith 3161 to 3167)
A "mukatab" is that slave who has entered into a written contract with his master for freedom, agreeing that upon payment of a certain amount, he will be set free. If a slave offers to purchase his freedom and agrees to pay the stipulated amount, then it is recommended (mustahabb) for the master, as a matter of good character, to accept his offer.
Allah Ta’ala’s statement is: «﴿فَكَاتِبُوهُمْإِنْعَلِمْتُمْفِيهِمْخَيْرًا .....﴾ [النور: 33]» And the right of inheritance (haqq-e-wirathat) of such a slave will also belong to his master and patron (sayyid) just as it does for a freed slave, because he has shown kindness to this slave, so the wala’ (right of allegiance) will remain his.
The explanation of the above-mentioned athar (narration) and the issue is mentioned in detail by Ibn Qudamah under Mas’alah (2009) in «و إذا اشترى المكاتبان كل واحد منهما صح شراء الاول و بطل شراء الآخر» in [المغنى 564/14].
Also see: [الكافي 600/2], [الانصاف 471/7], and [المبدع 355/6].