It is narrated from Sayyida Aisha (may Allah be pleased with her) that Sayyida Barirah (may Allah be pleased with her) was married to a slave. When she was set free, the Noble Prophet (peace and blessings be upon him) gave her authority over her own matter. In another narration, it is stated: When she was freed, she was given the choice.
Benefits: … When a male and female slave are husband and wife, and the wife is set free, she is given the choice to remain with her husband or not. Various opinions have been stated regarding compatibility (kafa’ah) and equality in marriage, such as: religion, freedom, lineage, profession, prosperity, freedom from defects, good means of earning, capability, etc. But in reality, the only valid attribute is Islam itself; after that, the consent of the boy and girl. However, they are also encouraged to give preference to religiosity over lineage, beauty, and wealth. In Islam, the greatest quality is piety (taqwa) and God-consciousness; in this lies honor and in this lies a good end. The command of Allah the Exalted is: {اِنَّاَکْرَمَکُمْعِنْدَاللّٰہِاَتْقَاکُمْ} “Indeed, the most honored of you in the sight of Allah is the most righteous of you.” (Surah al-Hujurat: 13)