The Messenger of Allah ﷺ was asked about a slave-woman who commits fornication while not married. He said, "If she commits fornication, flog her. Then if she commits fornication again, flog her. Then if she commits fornication again, flog her. Then if she commits fornication again, sell her, even for a rope of hair."Ibn Shihab said, "I do not know whether this was after the third or the fourth offense." A dafir is a rope.
حدثنا عبد الله بن مسلمة عن مالك عن ابن شهاب عن عبيد الله بن عبد الله بن عتبة
أن رسول الله ﷺ سئل عن الأمة إذا زنت ولم تحصن قال إن زنت فاجلدوها ثم إن زنت فاجلدوها ثم إن زنت فاجلدوها ثم إن زنت فبيعوها ولو بضفير قال ابن شهاب لا أدري في الثالثة أو الرابعة والضفير الحبل
Bukhari, Sales, chapter on selling a slave who has committed zina, no. 2153, 2154, and Muslim, Punishments, chapter on stoning Jewish dhimmis for zina, no. 32/1703, from the hadith of Malik through this same chain, and it is in Muwatta (Yahya) 2/826.