Ibn Jurayj (may Allah have mercy on him) says: I said to Ata' (may Allah have mercy on him): A man died, leaving two sons and a mukatab. The mukatab then came into the share of one of them, and he paid his contract to the one who received him in the inheritance. Then the mukatab died; who will inherit from him? He said: Both of them inherit from him; and Amr bin Dinar said the same. Ata' said: His wala' returns to the one who made the contract with him. I put it to him again, and he said that more than once.
Imam al-Shafi'i (may Allah have mercy on him) said: We hold the view of Ata' and Amr bin Dinar (may Allah have mercy on them both) regarding a mukatab with whom a man makes a contract, then the master dies, then the mukatab pays and is freed by the contract: his wala' belongs to the one who concluded his contract.
The Shaykh (may Allah have mercy on him) said: He (al-Shafi'i) did not adopt his view on dividing the mukatab (among the heirs), since he had said earlier: Division is a sale, and the sale of a mukatab is not permissible.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المكاتب / 21747