Sayyiduna Imran bin Husayn (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) said: "A vow made to commit sin and disobedience should not be fulfilled, nor should a vow be fulfilled which the son of Adam does not have the ability (i.e., power) to fulfill."
Hadith Referenceسنن دارمي / من النذور و الايمان / 2374
(Commentary on Hadith 2373) From this hadith, it is understood that there is no fulfillment of a vow (nadhar) in matters of sin. For example, if someone vows to slaughter their child or to fast on the day of Eid, then it is not obligatory to fulfill such a vow. According to the Ahl al-Hadith and the Hanafis, the expiation (kaffarah) for a sinful vow (nadhar al-ma‘siyah) is the expiation for an oath (qasam), because in the narration of Sahih Muslim, it is clarified that whoever makes a vow to commit a sin, its expiation is the expiation for an oath. According to the Shafi‘is, there is no expiation in such a vow, and the correct view is the first one.