Nafi' (may Allah have mercy on him) mentioned a story in which Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) asked: "Do you know Sayyiduna Umar bin al-Khattab (may Allah be pleased with him)?" He said: "Yes." He said: He (Sayyiduna Umar (may Allah be pleased with him)) said: "Any slave woman who bears a child to her master, he may enjoy her during his lifetime, and when he dies she is free. Whoever has intercourse with a slave woman and then neglects her, the child is his and the loss is upon him."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب عتق أمهات الأولاد / 21804
Imam al-Sha'bi (may Allah have mercy on him) said: The case of a man was brought before Judge Shurayh (may Allah have mercy on him): he had married a slave woman and she bore him children, then he bought her. Judge Shurayh (may Allah have mercy on him) referred the case to Ubaydah (may Allah have mercy on him), and Ubaydah (may Allah have mercy on him) said: "An umm walad is freed only when she bore the children free; when she bore them as slaves, she is not freed."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب عتق أمهات الأولاد / 21805