Muwatta Malik, Book 29, Hadith 1247 (In-Book)

Yahya related to me from Malik from Nafi that Abdullah ibn Umar was asked about a woman whose husband died while she was pregnant, and he said, "When she gives birth, she is free to marry." A man of the Ansar who was with him told him that Umar ibn al-Khattab had said, "Had she given birth while her husband was still on his bed, unburied, she would be free to marry."

وَحَدَّثَنِي عَنْ مَالِكٍ، عَنْ نَافِعٍ، عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ، أَنَّهُ سُئِلَ عَنِ الْمَرْأَةِ، يُتَوَفَّى عَنْهَا زَوْجُهَا وَهِيَ حَامِلٌ فَقَالَ عَبْدُ اللَّهِ بْنُ عُمَرَ إِذَا وَضَعَتْ حَمْلَهَا فَقَدْ حَلَّتْ ‏.‏ فَأَخْبَرَهُ رَجُلٌ مِنَ الأَنْصَارِ كَانَ عِنْدَهُ أَنَّ عُمَرَ بْنَ الْخَطَّابِ قَالَ لَوْ وَضَعَتْ وَزَوْجُهَا عَلَى سَرِيرِهِ لَمْ يُدْفَنْ بَعْدُ لَحَلَّتْ ‏.‏

sunnah.com

also referenced under: Book 29, Hadith 84 (USC-MSA)