Al-Aswad said that Sayyidah Aishah (may Allah be pleased with her), concerning the story of Barirah, said that the Prophet (peace and blessings be upon him) said: "Buy her; the wala' belongs only to the one who frees."
Imam al-Shafi'i (may Allah have mercy on him) said: The Prophet (peace and blessings be upon him) made no distinction. If the one who freed him dies, this (freed) slave will not inherit from him, because of the difference of religion.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الولاء / 21469