Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
malik:38-12Mālik > Balaghah

Malik related to me that he had heard that Fadala ibn Ubayd al- Ansari who was one of the companions of the Messenger of Allah ﷺ was asked whether it was permissible for a man who had to free a slave to free an illegitimate child. He said, "Yes, That will give satisfaction for him."  

مالك:٣٨-١٢وَحَدَّثَنِي مَالِكٌ أَنَّهُ بَلَغَهُ

عَنْ فَضَالَةَ بْنِ عُبَيْدٍ الأَنْصَارِيِّ وَكَانَ مِنْ أَصْحَابِ رَسُولِ اللَّهِ ﷺ أَنَّهُ سُئِلَ عَنِ الرَّجُلِ تَكُونُ عَلَيْهِ رَقَبَةٌ هَلْ يَجُوزُ لَهُ أَنْ يُعْتِقَ وَلَدَ زِنًا قَالَ نَعَمْ ذَلِكَ يُجْزِئُ عَنْهُ