Maymun bin Abi Shabib says that Sayyiduna Ali (may Allah be pleased with him) said: I obtained a slave woman along with her son. I intended to sell the slave woman and keep the child, but he (peace and blessings be upon him) said to me: "Sell them both or keep them both."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18307