All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The preponderant opinion of scholars is that if a fasting person eats or drinks out of forgetfulness, his fasting is valid because the Prophet, sallallaahu ‘alayhi wa sallam, said: "If anyone forgets that he is fasting and eats or drinks, then he should complete his fast for He is Allaah Who fed him and gave him drink." [Al-Bukhari and Muslim]
This ruling comprises all forms of fasting whether obligatory or voluntary. Therefore, if this happens to someone who is offering a fast that was intended upon a vow, he should complete his fasting as a matter of obligation as in Ramadan. This is not only permissible but obligatory.
Allaah Knows best.