Sahih Muslim , Hadith 1705

Abd al-Rahman reported that 'Ali, while delivering the address said: O people, impose the prescribed punishment upon your slaves, those who are married and those not married, for a slave-woman belonging to Allah's Messenger had committed adultery, and he committed me to flog her. But she had recently given birth to a child and I was afraid that if I flogged her I might kill her. So I mentioned that to Allah's Apostle and he said: You have done well.

حَدَّثَنَا مُحَمَّدُ بْنُ أَبِي بَكْرٍ الْمُقَدَّمِيُّ، حَدَّثَنَا سُلَيْمَانُ أَبُو دَاوُدَ، حَدَّثَنَا زَائِدَةُ، عَنِ السُّدِّيِّ، عَنْ سَعْدِ بْنِ عُبَيْدَةَ، عَنْ أَبِي عَبْدِ الرَّحْمَنِ، قَالَ خَطَبَ عَلِيٌّ فَقَالَ يَا أَيُّهَا النَّاسُ أَقِيمُوا عَلَى أَرِقَّائِكُمُ الْحَدَّ مَنْ أَحْصَنَ مِنْهُمْ وَمَنْ لَمْ يُحْصِنْ فَإِنَّ أَمَةً لِرَسُولِ اللَّهِ صلى الله عليه وسلم زَنَتْ فَأَمَرَنِي أَنْ أَجْلِدَهَا فَإِذَا هِيَ حَدِيثُ عَهْدٍ بِنِفَاسٍ فَخَشِيتُ إِنْ أَنَا جَلَدْتُهَا أَنْ أَقْتُلَهَا فَذَكَرْتُ ذَلِكَ لِلنَّبِيِّ صلى الله عليه وسلم فَقَالَ ‏ "‏ أَحْسَنْتَ ‏" ‏ ‏.‏

sunnah.com

This hadith has been narrated on the authority of as-Suddi with the same chain of trznsmitters, but he did not mention: " Those who are married and those who are not married." There is also an addition in it:" I spare her until she is all right."

وَحَدَّثَنَاهُ إِسْحَاقُ بْنُ إِبْرَاهِيمَ، أَخْبَرَنَا يَحْيَى بْنُ آدَمَ، حَدَّثَنَا إِسْرَائِيلُ، عَنِ السُّدِّيِّ، بِهَذَا الإِسْنَادِ وَلَمْ يَذْكُرْ مَنْ أَحْصَنَ مِنْهُمْ وَمَنْ لَمْ يُحْصِنْ ‏.‏ وَزَادَ فِي الْحَدِيثِ ‏ "‏ اتْرُكْهَا حَتَّى تَمَاثَلَ ‏" ‏ ‏.‏

sunnah.com