Sahih Muslim | Book 17 | Chapter 7
Narrated by Abd al-Rahman
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 (may peace be upon him) 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 (may peace be upon him) and he said: You have done well.
Narrated by as-Suddi
This hadith has been narrated on the authority of as-Suddi with the same chain of transmitters, 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.