Abu Salama reported,

I was with Ibn Abbas and Abu Hurairah when Ibn Abbas said, "When a woman gives birth after the death of her husband, her waiting period is the longer of the two terms."Abu Salama said, "We sent Kurayb to Umm Salama to ask her about this."He came back to us with her reply that Sabi's husband died, and she gave birth a few days after his death, then the Messenger of Allah ﷺ instructed her that she could marry.

Nasai 3545

Sahih

أخبرنا حسين بن منصور قال حدثنا جعفر بن عون قال حدثنا يحيى بن سعيد قال أخبرني سليمان بن يسار قال أخبرني

أبو سلمة بن عبد الرحمن قال

كنت أنا وابن عباس وأبو هريرة فقال ابن عباس إذا وضعت المرأة بعد وفاة زوجها فإن عدتها آخر الأجلين فقال أبو سلمة فبعثنا كريبا إلى أم سلمة يسألها عن ذلك فجاءنا من عندها أن سبيعة توفي عنها زوجها فوضعت بعد وفاة زوجها بأيام فأمرها رسول الله ﷺ أن تتزوج

النسائي 3545صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Divorce
Chapter
Waiting period of a pregnant woman whose husband has died
Numbering
Darussalam 3545
Nasai 3545