“Whoever commits adultery with a slave woman or a free woman, his child is illegitimate, and he cannot inherit from him or be inherited from (i.e., this child cannot inherit from him).”
قَالَ رَسُولُ اللَّهِ ﷺ مَنْ عَاهَرَ أَمَةً أَوْ حُرَّةً فَوَلَدُهُ وَلَدُ زِنًا لاَ يَرِثُ وَلاَ يُورَثُ