It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "When a mukatab (a slave who has made a contract to buy his freedom) dies and leaves an inheritance, or commits a crime for which a hadd punishment is due, he inherits in proportion to the part of him that has been freed, and the hadd is carried out on him in proportion to the part of him that has been freed."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11807