If a woman promises her husband not to marry after his death, she does not have to fulfil this promise. She is allowed to marry another man after her husband’s death, but she should offer expiation for breaking the oath. The expiation is feeding ten needy people or clothing them or fasting for three days. Referring to this ruling, Allah the Almighty says: “Allah will not take you to task for that which is unintentional in your oaths, but He will take you to task for the oaths which ye swear in earnest. The expiation thereof is the feeding of ten of the needy with the average of that wherewith ye feed your own folk, or the clothing of them, or the liberation of a slave, and for him who findeth not (the wherewithal to do so) then a three day fast. This is the expiation of your oaths when ye have sworn; and keep your oaths. Thus Allah expoundeth unto you His revelations in order that ye may give thanks” (Al-Ma’idah 5: 89).

The Standing Committee for Islamic Research and Ifta’ states: It is permissible for a woman to marry after her husband’s death, but she should offer expiation for her oath because the Prophet (peace and blessings be upon him) said: “By Allah, if Allah wills, I do not swear an oath then see something better than it but I will offer expiation for my oath and do that which is better” (Bukhari and Muslim). The Prophet (peace and blessings be upon him) also said: “If you swear an oath then you see something that is better than it, offer expiation for your oath and do that which is better” (Bukhari and Muslim).
Marriage is better for this woman than remaining unmarried because her needs will be fulfilled.