It is narrated from Nafi' (may Allah have mercy on him) that Ibn Umar (may Allah be pleased with them both) was asked about a pregnant woman: what should she do if she fears for her child? He (may Allah be pleased with him) replied: She should not fast and for each day she should feed a poor person with one mudd of wheat.
Hadith Referenceمسند الإمام الشافعي / كتاب الصيام / 653
Hadith Takhrijصحيح اخرجه البيهقي : 230/4 وفي المعرفة السنن والآثار له (2488)۔