Sahih Muslim Book 9, Hadith Number 3591.

Chapter: The right of inheritance of property vests with one who emancipates the slave.

‘Aisha (Allah be pleased with her) reported: She wanted to buy Barira with a view to emancipating her. They (the sellers) laid down the condition that the right of inheritance would vest (with them). She (Hadrat ‘Aisha) made a mention of that to Allah’s Messenger (may peace be upon him), whereupon he said: Buy her and emancipate her for the right of inheritance vests with one who emancipates. Allah’s Messenger (may peace be upon him) was given meat as gift. They (his Companions) said to Allah’s Apostle (may peace be upon him): This was given as charity to Barira, whereupon he said: That is charity for her but gift for us. And she was given option (to retain her matrimonial alliance or to break it). Abd al-Rahman said: Her husband was a free man. Shu’ba said: I then asked him (one of the narrators) about Barira’s husband (whether he had been a free mart or a slave), whereupon he said: I do not know.