Yahya related to me from Malik from Abdu Rabbih ibn Said ibn Qays that Abu Salama ibn Abd ar-Rahman said that Abdullah ibn Abbas and Abu Hurayra were asked when a pregnant woman whose husband had died could remarry. Ibn Abbas said, "At the end of two periods." Abu Hurayra said, "When she gives birth, she is free to marry." Abu Salama ibn Abd ar-Rahman visited Umm Salama, the wife of the Prophet ﷺ and asked her about it Umm Salama said, ''Subaya al-Aslamiya gave birth half a month after the death of her husband, and two men asked to marry her. One was young and the other was old. She preferred the young man and so the older man said, 'You are not free to marry yet.' Her family were away and he hoped that when her family came, they would give her to him. She went to the Messenger of Allah ﷺ and he said, 'You are free to marry, so marry whomever you wish.' "
أَنَّهُ قَالَ سُئِلَ عَبْدُ اللَّهِ بْنُ عَبَّاسٍ وَأَبُو هُرَيْرَةَ عَنِ الْمَرْأَةِ الْحَامِلِ يُتَوَفَّى عَنْهَا زَوْجُهَا فَقَالَ ابْنُ عَبَّاسٍ آخِرَ الأَجَلَيْنِ وَقَالَ أَبُو هُرَيْرَةَ إِذَا وَلَدَتْ فَقَدْ حَلَّتْ فَدَخَلَ أَبُو سَلَمَةَ بْنُ عَبْدِ الرَّحْمَنِ عَلَى أُمِّ سَلَمَةَ زَوْجِ النَّبِيِّ ﷺ فَسَأَلَهَا عَنْ ذَلِكَ فَقَالَتْ أُمُّ سَلَمَةَ وَلَدَتْ سُبَيْعَةُ الأَسْلَمِيَّةُ بَعْدَ وَفَاةِ زَوْجِهَا بِنِصْفِ شَهْرٍ فَخَطَبَهَا رَجُلاَنِ أَحَدُهُمَا شَابٌّ وَالآخَرُ كَهْلٌ فَحَطَّتْ إِلَى الشَّابِّ فَقَالَ الشَّيْخُ لَمْ تَحِلِّي بَعْدُ وَكَانَ أَهْلُهَا غَيَبًا وَرَجَا إِذَا جَاءَ أَهْلُهَا أَنْ يُؤْثِرُوهُ بِهَا فَجَاءَتْ رَسُولَ اللَّهِ ﷺ فَقَالَ قَدْ حَلَلْتِ فَانْكِحِي مَنْ شِئْتِ