--- ../gawk-3.1.5-fc4-32/builtin.c 2005-07-26 14:07:43.000000000 -0400 +++ builtin.c 2006-07-07 16:54:42.212660000 -0400 @@ -2462,6 +2462,15 @@ sub_common(NODE *tree, long how_many, in free(t->stptr); t->stptr = buf; t->stlen = textlen; +#ifdef MBS_SUPPORT + if (t->wstptr != NULL) { + assert((t->flags & WSTRCUR) != 0); + free(t->wstptr); + } + t->flags &= ~WSTRCUR; + t->wstptr = NULL; + t->wstlen = 0; +#endif free_temp(s); if (matches > 0 && lhs) {