Muwatta Imam Malik Book of The Mukatab, Hadith 12
Malik said, "When a mukatab sets his own slaves free, it is only permitted for a mukatab to set his own slaves free with the consent of his master. If his master gives his consent and the mukatab sets his slave free, his wala' goes to the mukatab . If the mukatab then dies before he has been set free himself, the wala' of the freed slave goes to the master of the mukatab. If the freed one dies before the mukatab has been set free, the master of the mukatab inherits from him."
Malik said, "It is like that also when a mukatab gives his slave a kitaba and his mukatab is set free before he is himself. The wala' goes to the master of the mukatab as long as he is not free. If this one who wrote the kitaba is set free, then the wala' of his mukatab who was freed before him reverts to him. If the first mukatab dies before he pays, or he cannot pay his kitaba and he has free children, they do not inherit the wala' of their father's mukatab because the wala' has not been established for their father and he does not have the wala' until he is free."
Malik spoke about a mukatab who was shared between two men and one of them forewent what the mukatab owed him and the other insisted on his due. Then the mukatab died and left property.
Malik said, "The one who did not abandon any of what he was owed, is paid in full. Then the property is divided between them both just as if a slave had died because what the first one did was not setting him free. He only abandoned a debt that was owed to him ."
Malik said, "One clarification of that is that when a man dies and leaves a mukatab and he also leaves male and female children and one of the children frees his portion of the mukatab, that does not establish any of the wala' for him. Had it been a true setting free, the wala' would have been established for whichever men and women freed him."
Malik said, "Another clarification of that is that if one of them freed his portion and then the mukatab could not pay, the value of what was left of the mukatab would be altered because of the one who freed his portion. Had it been a true setting-free, his estimated value would have been taken from the property of the one who set free until he had been set completely free as the Messenger of Allah ﷺ said, 'Whoever frees his share in a slave and has money to cover the full price of the slave, justly evaluated for him, gives his partners their shares. If not, he frees of him what he frees.' " (See Book 37 hadith 1).
He said, "Another clarification of that is that part of the sunna of the muslims in which there is no dispute, is that whoever frees his share of a mukatab, the mukatab is not set fully free using his property. Had he been truly set free, the wala' would have been his alone rather than his partners. Part of what will clarify that also is that part of the sunna of the muslims is that the wala' belongs to whoever writes the contract of kitaba. The women who inherit from the master of the mukatab do not have any of the wala' of the mukatab. If they free any of their share, the wala' belongs to the male children of the master of the mukatab or his male paternal relations."