حَدَّثَنَا جَعْفَرُ بْنُ عَوْنٍ، عَنْ سَعِيدٍ، عَنْ أَبِي مَعْشَرٍ، عَنْ إِبْرَاهِيمَ، قَالَ: "إِذَا مَاتَ الْمَيِّتُ وَجَبَتْ الْحُقُوقُ لِأَهْلِهَا، وَلَمْ يَجْعَلْ لِمَنْ أَسْلَمَ أَوْ أُعْتِقَ قَبْلَ أَنْ يُقْسَمَ الْمِيرَاثُ شَيْئًا".
Ibrahim, may Allah have mercy on him, said: When a man dies, the right of inheritance becomes obligatory for the heir, and whoever becomes Muslim or is freed before the distribution of inheritance, nothing from the inheritance is kept for him.
Brief Explanation
(Commentary on Hadith 3031)
That is, if after a person's death his heir, who was a disbeliever, becomes Muslim before the distribution (of inheritance), even then he will not be an heir. Similarly, if a slave is set free after the death (of the deceased) but before the distribution, he will also not receive inheritance, because during the lifetime of the deceased he was of a different religion and an impediment to inheritance.