Sahih Muslim Book 009, Hadith Number 3585.
Chapter: The right of inheritance of property vests with one who emancipates the slave.
'Aisha (Allah be pleased with her) reported that Barira came to her in order to seek her help in securing freedom, but she had (so far) paid nothing out of that sum stipulated in the contract. 'A'isba said to her. Go to your family (who owns you), and if they like that I should pay the amount (of the contract) on your behalf (for purchasing your freedom), then I shall have the right in your inheritance. (If they accepted it) I am prepared (to make this payment). Barira made a mention of that to the (members of) her family, but they refused and said: If she (Hadrat 'Aisha) wants to do good to You for the sake of Allah, she may do it, but the right of inheritance will be ours. She (Hadrat 'Aisha) made a mention of that to Allah's Messenger (may peace be upon him), and he said to her: Buy her, and emancipate her, for the right of inheritance vests with one who emancipates (the slave). Allah's Messenger, may peace be upon him) then stood up and said: What has happened to the people that they lay down conditions which are not (found) in the Book of Allah? And he who laid down a condition not found in the Book of Allah that is not valid, even if it is laid down hundred times. The condition laid down by Allah is the most weighty and the most valid.