If the woman dies within 40 days of giving birth, she will die as a shahid (matyr).
"A woman that dies in her virginity or during her pregnancy or at the time of birth or thereafter (in nifaas) will attain the rank of a martyr" Hadeeth
Nabi (salalaallahu alayhi wassallam) is reported to have also said
".......When her labour pains commence, the inhabitants of the earth and the sky are unaware of the stores of comfort that are prepared for her. When she delivers and breast feeds her child, then she will be granted a reword for every gulp of milk, if she had to remain awake during the night for the sake of the child, she will receive the reword of emancipating seventy slaves in the path of Allah Ta'ala. O Salaamat! Do you know who these women are? They are pious, upright, with a delicate nature yet obedient to their husbands and not ungrateful to them"
Source : Madrasa In'aamiyyah