It is narrated from Sayyiduna Ibn Mas'ud (may Allah be pleased with him) that he said: "If a slave woman is freed while married to a slave (husband), and she does not know that she has the choice (to annul the marriage), or she is not given the choice until her husband is also freed, or he dies, or she herself dies, then they inherit from each other."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 9645