There are several cases of vows with strange conditions in the Bible. Many of these are rash vows, often morally negligent or suspect. In Joshua 9, the Israelites make a covenant with Gibeon under the false pretense that they were from far away, when they had a command from God to wipe out any of the peoples of the land. Once they made the vow, they honored the covenant with Gibeon and didn't kill them rather than keeping the command of God to wipe them out. In Judges 11, Jephthah vows to sacrifice the first thing to come through his gate, expecting it to be an animal, and it turns out to be his daughter. In a very tragic move, he ends up fulfilling his vow and sacrificing her.
King Saul makes a similarly rash vow in I Samuel 14. He says that if any of his soldiers eat during their attack, they would be put to death. His son Jonathan wasn't present for that vow, and when he found honey in the woods he ate some. In this case, however, Saul's soldiers convince him not to keep the vow. You get the sense that he only did it because his men were able to calm him down and talk some reason into him.
In I Kings 2, Solomon makes a promise to Bathsheba to grant her a favor but then refuses once he finds out that the favor was to do something that would in effect give his older half-brother Adonijah a foothold toward claiming the throne that David had passed on to Solomon. Adonijah flees Solomon's wrath and in fact has him killed. Adonijah had already been spared once when he grabbed the horns of the altar, and Solomon had let him go on the condition that he shows himself to be worthy; otherwise, he'd die. His request to Bathsheba showed Solomon the latter.
In the gospels, King Herod makes a promise to his step-daughter that he'd give her anything, up to half his kingdom, and is shocked when she asks for the head of John the Baptist. He complies to save face but perhaps only for that reason.
It's worth thinking through the conflicting moral principles that arise in these cases. The most fundamental is the third commandment the third commandment (not to take God's name in vain), which Jesus interprets simply as a command to let your "yes" be "yes" and your "no" be "no". The third commandment says not to use God's name in a way that doesn't take into full account who God is and our place in God's universe. The most fundamental way that we can take God's name in vain is simply to ignore God, thus living in a way that ignores God is the most serious violation of the third commandment. This is especially important for a people called to represent God as his ambassadors to the world, since the representation is a fact, and thus representing God badly takes his name in vain and drags it through the mud. But uttering God's name when you don't have any intention of referring to God, particularly in a sinful act of verbal outrage over something not all that important. So the common view that using a name that normally refers to God in a sort of curse is indeed correct. It's a violation of the third commandment. It's just not the most fundamental way to do so.