Ma'bad al-Juhani (may Allah have mercy on him) narrates from Sayyiduna Mu'awiyah (may Allah be pleased with him): When the mukatab dies and leaves enough wealth to pay off the kitabah, his masters are given what is theirs, and whatever remains is given to the heirs.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المكاتب / 21687