Al-Aswad (may Allah have mercy on him) narrated that Sayyiduna Umar (may Allah be pleased with him) said: When a slave marries a free woman and she gives birth, the children become free along with their mother's freedom, and their wala belongs to those who freed their mother. When the father is freed, the wala is transferred to those who freed the father.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الولاء / 21517