Imam al-Shafi'i (may Allah have mercy on him) said: "She (the umm walad) remains owned (a slave woman) as she is, except that it is not permissible for her master to sell her, nor to remove her from his ownership by any means other than manumission; and when he (the master) dies, she becomes free out of the capital (of the estate)."
He (Imam al-Shafi'i, may Allah have mercy on him) said: "This (position) is in following Sayyiduna Umar bin al-Khattab (may Allah be pleased with him)."
Abdullah bin Umar (may Allah be pleased with them both) narrates from Sayyiduna Umar bin al-Khattab (may Allah be pleased with him) that any slave woman who bears a child to her master is not to be sold, given as a gift or made part of an inheritance; the master may enjoy her, and after his death she is free.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المكاتب / 21763