Muwatta Malik #1575
Setting Free and Wala'
The Arabic includes the chain of narration (sanad) and the collector's commentary; the English translation shows the Prophet's words only.
وَحَدَّثَنِي مَالِكٌ، أَنَّهُ بَلَغَهُ عَنْ فَضَالَةَ بْنِ عُبَيْدٍ الأَنْصَارِيِّ، وَكَانَ، مِنْ أَصْحَابِ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ سُئِلَ عَنِ الرَّجُلِ تَكُونُ عَلَيْهِ رَقَبَةٌ هَلْ يَجُوزُ لَهُ أَنْ يُعْتِقَ وَلَدَ زِنًا قَالَ نَعَمْ ذَلِكَ يُجْزِئُ عَنْهُ .
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, may
Allah bless him and grant him peace, 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."
About Muwatta Malik
This hadith is #1575 from Muwatta Malik, in the Book of Setting Free and Wala'.