The Messenger of Allah ﷺ as saying: The right of inheritance belongs to only to the one who paid the price (of the slave) and patronised him by doing an act of gratitude.
قَالَ رَسُولُ اللَّهِ ﷺ الْوَلاَءُ لِمَنْ أَعْطَى الثَّمَنَ وَوَلِيَ النِّعْمَةَ