Maliks Muwatta Book 21, Hadith Number 17.
Yahya related to me from Malik that it reached him that a slave of Abdullah ibn Umar escaped and one of his horses wandered off, and the idol worshippers seized them. Then the Muslims recaptured them, and they were returned to Abdullah ibn Umar, before the division of the spoils took place.
I heard Malik say about muslim property that had been seized by the enemy, “If it is noticed before the distribution, then it is returned to its owner. Whatever has already been distributed is not returned to anyone.”
Malik, when asked about a man whose young male slave was taken by the idol worshippers and then the Muslims re-captured him, said, “The owner is more entitled to him without having to pay his price or value or having to incur any loss before the distribution takes place. If the distribution has already taken place then I think that the slave belongs to his master for his price if the master wants him back.”
Regarding an umm walad of a Muslim man who has been taken by the idol worshippers and then recaptured by the Muslims and allotted in the distribution of spoils and then recognised by her master after the distribution, Malik said, “She is not to be enslaved. I think that the Imam should pay a ransom for her for her master. If he does not do it, then her master must pay a ransom for her and not leave her. I do not think that she should be made a slave by whoever takes her and intercourse with her is not halal. She is in the position of a free woman because her master would be required to pay compensation if she injured somebody and so she is in the same position (as a wife). He must not leave the mother of his son to be enslaved nor may intercourse with her be made halal.”
Malik was asked about a man who went to enemy territory to pay ransom or to trade, and he bought a free man or a slave, or they were given to him. He said, “As for the free man, the price he buys him for is a debt against the man and he is not made a slave. If the captive is given to him freely, he is free and owes nothing unless the man gave something in recompense for him. That is a debt against the free man, the same as if a ransom had been paid for him. As for a slave, his former master can choose to take him back and pay his price to the man who bought him or he can choose to leave him, as he wishes. If he was given to the man, the former master is more entitled to him, and he owes nothing for him unless the man gave something for him in recompense. Whatever he gave for him is a loss against the master if he wants him back.”