Sahih al-Bukhari, Hadith 2735

Narrated `Amra: Aisha said that Buraira came to seek her help in the writing of her emancipation. `Aisha said to her, "If you wish, I will pay your masters (your price) and the wala' will be for me." When Allah's Messenger came, she told him about it. The Prophet said to her, "Buy her (i.e. Buraira) and manumit her, for the Wala is for the one who manumits." Then Allah's Messenger ascended the pulpit and said, "What about those people who stipulate conditions which are not in Allah's Laws? Whoever stipulates such conditions as are not in Allah's Laws, then those conditions are invalid even if he stipulated a hundred such conditions."

حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ اللَّهِ، حَدَّثَنَا سُفْيَانُ، عَنْ يَحْيَى، عَنْ عَمْرَةَ، عَنْ عَائِشَةَ ـ رضى الله عنها ـ قَالَتْ أَتَتْهَا بَرِيرَةُ تَسْأَلُهَا فِي كِتَابَتِهَا، فَقَالَتْ إِنْ شِئْتِ أَعْطَيْتُ أَهْلَكِ وَيَكُونُ الْوَلاَءُ لِي‏.‏ فَلَمَّا جَاءَ رَسُولُ اللَّهِ صلى الله عليه وسلم ذَكَّرْتُهُ ذَلِكَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ ابْتَاعِيهَا فَأَعْتِقِيهَا، فَإِنَّمَا الْوَلاَءُ لِمَنْ أَعْتَقَ ‏"‏‏.‏ ثُمَّ قَامَ رَسُولُ اللَّهِ صلى الله عليه وسلم عَلَى الْمِنْبَرِ فَقَالَ ‏"‏ مَا بَالُ أَقْوَامٍ يَشْتَرِطُونَ شُرُوطًا لَيْسَتْ فِي كِتَابِ اللَّهِ مَنِ اشْتَرَطَ شَرْطًا لَيْسَ فِي كِتَابِ اللَّهِ فَلَيْسَ لَهُ، وَإِنِ اشْتَرَطَ مِائَةَ شَرْطٍ ‏"‏‏.‏

sunnah.com