'Aishah, mother of believers (ra), intended to buy a slave-girl to set her free. Her people said: We shall sell her to you on one condition that we shall inherit from her. 'Aishah mentioned it to the Messenger of Allah ﷺ. He said: That should not prevent you, for the right of inheritance belongs to the one who has set a person free. (Using translation from Abū Dāʾūd 2915)
أَنَّ عَائِشَةَ زَوْجَ النَّبِيِّ ﷺ أَرَادَتْ أَنْ تَشْتَرِيَ وَلِيدَةً فَتُعْتِقَهَا فَقَالَ أَهْلُهَا نَبِيعُكِهَا عَلَى أَنَّ وَلَاءَهَا لَنَا فَذَكَرَتْ ذَلِكَ لِرَسُولِ اللهِ ﷺ فَقَالَ لَا يَمْنَعْكِ ذَلِكَ فَإِنَّمَا الْوَلَاءُ لِمَنْ أَعْتَقَ أَخْرَجَاهُ فِي الصَّحِيحِ مِنْ حَدِيثِ مَالِكٍ