It was narrated from Hisham bin 'Urwah, from his father, about 'Aishah the wife of the Prophet (ﷺ) - :
that Barirah came to her when she was came to her when she was Muktabah, and her masters had written a contract of manumission for nine Uqiyyah. She (`Aishah) said: "If your masters wish I will pay them that in one sum, and the right of inheritance will belong to me."He said: "So she went to her masters and told them about that, but they insisted that the right of inheritance should belong to them. `Aishah mentioned that to the Prophet (ﷺ) and he said: 'Do it.' Then the Prophet (ﷺ) stood up and addressed the people. He praised and glorified Allah (SWT), then he said: 'What is the matter with some people who stipulated conditions that are not in the Book of Allah (SWT)? Every conditions that is not in the Book of Allah (SWT) is invalid, even if there are one hundred conditions. The Book of Allah(SWT) is more deserving of being followed and the conditions of Allah (SWT) are more binding. And the Wala belongs to the one who manumits (the slave)."
English reference: Vol. 3, Book 19, Hadith 2521
Arabic reference: Book 19, Hadith 2617