It is narrated from Sayyiduna Ali (may Allah be pleased with him) that a woman inherited a slave from her husband's property. The matter was brought before Sayyiduna Ali (may Allah be pleased with him), and he said (to the slave): Have you had intercourse with her? He said: No. Sayyiduna Ali (may Allah be pleased with him) said: Had you had intercourse with her, I would have stoned you. Then he said to the woman: He is your slave; if you wish, sell him; if you wish, give him away as a gift; and if you wish, set him free and marry him.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النكاح / 13737