She must observe the waiting period of whichever of the two terms ends later.Abu Salama said, "Rather, she becomes lawful for marriage as soon as she gives birth."Abu Hurairah said, "I side with my nephew," meaning Abu Salama.So they sent word to Umm Salama, the wife of the Prophet ﷺ, who replied, "Sabia al-Aslamia gave birth shortly after her husband's death, and she sought a ruling from the Messenger of Allah ﷺ, who instructed her that she could marry."
حدثنا قتيبة حدثنا الليث عن يحيى بن سعيد عن سليمان بن يسار أن أبا هريرة وابن عباس وأبا سلمة بن عبد الرحمن تذاكروا المتوفى عنها زوجها الحامل تضع عند وفاة زوجها
تعتد آخر الأجلين وقال أبو سلمة بل تحل حين تضع وقال أبو هريرة أنا مع ابن أخي يعني أبا سلمة فأرسلوا إلى أم سلمة زوج النبي ﷺ فقالت قد وضعت سبيعة الأسلمية بعد وفاة زوجها بيسير فاستفتت رسول الله ﷺ فأمرها أن تتزوج
Muslim also narrated it in the Book of Divorce, chapter on the completion of the waiting period of a woman whose husband has died and others, by the delivery of her pregnancy, hadith no. 1485, from the hadith of Layth bin Saad, with this wording. The hadith has other routes of transmission in Bukhari, hadith no. 4909, and elsewhere.