It is narrated from Sulaiman bin Yasar (may Allah have mercy on him) that Ibn Abbas and Abu Salamah (may Allah be pleased with them) differed regarding a woman whose husband died and she gave birth to a child a few days later. Ibn Abbas (may Allah be pleased with him) said, "She must observe the longer of the two waiting periods." But Abu Salamah (may Allah be pleased with him) said, "When she experiences postnatal bleeding, her waiting period is over." Sulaiman said that Abu Hurairah (may Allah be pleased with him) also arrived and said, "I am with my nephew, i.e., Abu Salamah (meaning my ruling is the same)." Finally, they sent Ibn Abbas’s freed slave, Kuraib, to Umm Salamah, and he asked her about this issue. Then he returned to them and reported that she said: Subai’ah (may Allah be pleased with her) gave birth to a child a few days after her husband’s death, and she mentioned this to the Messenger of Allah (ﷺ), so he said to her: "Your waiting period is over, so you may marry."
Hadith Referenceمسند الإمام الشافعي / كتاب العدد والسكنى والنفقات / 1302
Hadith Takhrijاخرجه البخاري، التفسير ، باب ﴿وأولات الأحمال اجلهن أن يضعن حملهن ...﴾ (4909) ، (5318)۔ و مسلم الطلاق باب انقضاء عدة المتوفى عنها وغيرها، بوضع الحمل (1585)۔