Abu Dawud Book 24, Hadith Number 3952.
Chapter : Emancipation of a bastard slave.
Narated By Abu Hurairah : The Prophet (PBUH) said: The child of adultery is worst of the three.
Abu Hurairah said: That I give a flog in the path of Allah (as a charity) is dearer to me than emancipating a child of adultery.