"Ibn 'Abbas and Abu Hurairah were asked about the woman whose husband dies when she is pregnant. Ibn 'Abbas said: '(She should wait) for the longer of the two periods.' Abu Hurairah said: 'When she gives birth it becomes permissible for her to marry.' Abu Salamah went to Umm Salamah and asked her about that, and she said: 'Subai'ah Al-Aslamiyyah gave birth half a month after her husband died, and two men proposed to her. One was young and one was old, and she was inclined toward the young one. So the old one said: It is not permissible for you to marry. Her family was not there, and he hoped that if he went to her family they would marry her to him. She went to the Messenger of Allah and he said: It is permissible for you to marry, so marry whomever you want.'"
وَقَالَ أَبُو هُرَيْرَةَ إِذَا وَلَدَتْ فَقَدْ حَلَّتْ فَدَخَلَ أَبُو سَلَمَةَ إِلَى أُمِّ سَلَمَةَ فَسَأَلَهَا عَنْ ذَلِكَ فَقَالَتْ وَلَدَتْ سُبَيْعَةُ الأَسْلَمِيَّةُ بَعْدَ وَفَاةِ زَوْجِهَا بِنِصْفِ شَهْرٍ فَخَطَبَهَا رَجُلاَنِ أَحَدُهُمَا شَابٌّ وَالآخَرُ كَهْلٌ فَحَطَّتْ إِلَى الشَّابِّ فَقَالَ الْكَهْلُ لَمْ تَحْلِلْ وَكَانَ أَهْلُهَا غُيَّبًا فَرَجَا إِذَا جَاءَ أَهْلُهَا أَنْ يُؤْثِرُوهُ بِهَا فَجَاءَتْ رَسُولَ اللَّهِ ﷺ فَقَالَ قَدْ حَلَلْتِ فَانْكِحِي مَنْ شِئْتِ