It is narrated from Sayyiduna al-Miswar bin Makhramah (may Allah be pleased with him) that Subay'ah al-Aslamiyyah (may Allah be pleased with her) gave birth a few nights after the death of her husband. She came to the Messenger of Allah (peace and blessings be upon him) and asked the Prophet (peace and blessings be upon him) for permission to marry, and he (peace and blessings be upon him) gave her permission. And in the narration of Ja'far: The husband of Subay'ah al-Aslamiyyah (may Allah be pleased with her) died; she stayed only a few nights and then gave birth. When she was free of her postnatal bleeding, she mentioned the matter to the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) permitted her to marry, and she married.
Imam al-Bukhari (may Allah have mercy on him) narrated it.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب العدد / 15467