patch 8.2.1160: Vim9: memory leak in allocated types
Problem: Vim9: memory leak in allocated types.
Solution: Free the type pointers.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 0aae8f2..c0e4674 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -321,6 +321,14 @@
return type;
}
+ void
+clear_type_list(garray_T *gap)
+{
+ while (gap->ga_len > 0)
+ vim_free(((type_T **)gap->ga_data)[--gap->ga_len]);
+ ga_clear(gap);
+}
+
static type_T *
get_list_type(type_T *member_type, garray_T *type_gap)
{