It is narrated from Abu Salamah (may Allah have mercy on him) that he, Ibn Abbas and Abu Hurayrah (may Allah be pleased with them both) discussed the man who dies (leaving his wife) and she gives birth a few days after his death. Abu Salamah (may Allah have mercy on him) said: I said: When she has given birth, she has become lawful (for marriage). And Ibn Abbas (may Allah be pleased with them both) said: Her waiting period is the later of the two terms. The two of them argued back and forth over it. Abu Hurayrah (may Allah be pleased with him) said: I am with my nephew, Abu Salamah. They sent Kurayb, the freed slave of Ibn Abbas (may Allah be pleased with them both), to Umm Salamah (may Allah be pleased with her). Umm Salamah (may Allah be pleased with her) said that Subay'ah al-Aslamiyyah (may Allah be pleased with her) gave birth forty nights after the death of her husband, and a man of Banu Abd al-Dar whose kunyah was Abu al-Sanabil proposed to her and informed her that she had become lawful, and she intended to marry another man. Abu al-Sanabil said to her: You have not become lawful. Subay'ah (may Allah be pleased with her) mentioned this to the Messenger of Allah (peace and blessings be upon him), and he (peace and blessings be upon him) ordered her: "Marry."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب العدد / 15471