Muhammad bin Sirin (may Allah have mercy on him) said that a free woman was married to a slave and had children by him; then the slave was freed, and Qadi Shurayh (may Allah have mercy on him) gave the judgement that the wala is transferred.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الولاء / 21527