One who says to his maidservant, "Behold, you are a free woman, but your child is a slave" - her child is like her; these are the words of Rabbi Yose the Galilean. For it is said, "the woman and her children shall belong to her master" (Exodus 21:4): at the time the woman belongs to her master, her child belongs to her master; if the woman does not belong to her master, her child does not belong to her master. And the Sages say: his words stand. The maidservant and the gentile woman - her child is like her.
You Are Free But Your Child Is a Slave
Yalkut Shimoni on Torah 314:2
הָאוֹמֵר לְשִׁפְחָתוֹ, הֲרֵי אַתְּ בַּת חוֹרִין וּוְלָדֵךְ עֶבֶד, וְלָדָהּ כָּמוֹהָ דִּבְרֵי רַבִּי יוֹסִי הַגְּלִילִי. שֶׁנֶּאֱמַר הָאִשָּׁה וִילָדֶיהָ תִּהְיֶה לַאדֹנֶיהָ, בִּזְמַן שֶׁהָאִשָּׁה לַאדֹנֶיהָ, וְלָדָהּ לַאדֹנֶיהָ, אֵין הָאִשָּׁה לַאדֹנֶיהָ, אֵין וְלָדָהּ לַאדֹנֶיהָ. וַחֲכָמִים אוֹמְרִים דְּבָרָיו קַיָּמִין. הַשִּׁפְחָה וְהַנָכְרִית וְלָדָהּ כָּמוֹהָ.