The ruling if a slave involved in these scenarios was gifted to another person.
General Chapter
Al-Mughni
Book of Bequests
Primary text
If the slave in any of these preceding scenarios was gifted to another person, the recipient of the gift has a claim on the slave and his earnings equal to the share that the slave himself has in his own person and earnings.