Reference: Fataawa Noor ‘alad-Darb – Question No.6119, Page 541, Volume 11
Question: If someone undertakes a vow whilst asleep, is he required to fulfil that vow or not?
Response: The vow of the one who is asleep means nothing; that is because him doing so whilst asleep is not binding. So all actions done whilst asleep amount to nothing, [simply put] no action can be attributed to the one who is asleep – even if he divorced his wife, or declared his wealth in trust for a noble cause, or declared his wife impermissible for himself. That is because the one who is asleep is not legally accountable for his actions except in one particular matter, and that is something in which even the one who is ignorant of the ruling is not excused, such as when he turns over in bed and causes the death of another, in which case he is required to pay a penalty. Such as if a mother turns over [in bed] and [unbeknownst to her] she smothers the child [next to her] and he dies, and in this case she is required to pay a penalty.
And the evidence suggesting the one who is asleep is not held accountable for his actions is the saying of Allaah (Tabaara-kAllaah) regarding the People of the Cave:
…so Allaah (Ta’aala) did not render their turning right and left to themselves, rather to Himself (Tabaaraka wa Ta’aala).