Yoreh Deah Siman 267 Seif 64
סד הַמַּפְקִיר עַבְדּוֹ, יָצָא לְחֵרוּת וְצָרִיךְ גֵּט שִׁחְרוּר. וְאִם מֵת קֹדֶם שֶׁשִּׁחְרְרוֹ, הַיּוֹרֵשׁ כּוֹתֵב לוֹ גֵּט שִׁחְרוּר.
If someone declare his slave ownerless, the slave is granted his freedom. A bill of release is composed for him. If the master who declared him ownerless dies, his heir should compose the bill of release.