patch 9.1.0992: Vim9: double-free after v9.1.0988
Problem: Vim9: double-free after v9.1.0988
(h-east)
Solution: clear typval pointer, before setting the type
(Yegappan Lakshmanan)
Otherwise the contents are still referring to some other value.
fixes: #16386
closes: #16388
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9execute.c b/src/vim9execute.c
index dde95b5..d696280 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -4855,6 +4855,7 @@
+ iptr->isn_arg.jumparg.jump_arg_off
+ STACK_FRAME_SIZE;
type_T *t = ufunc->uf_arg_types[argidx];
+ CLEAR_POINTER(tv);
tv->v_type = t->tt_type;
}