diff src/userfunc.c @ 21218:1f4d0375f947 v8.2.1160

patch 8.2.1160: Vim9: memory leak in allocated types Commit: https://github.com/vim/vim/commit/6110e79a5872dd6c5529f909d1bd670e3325927b Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 8 19:35:21 2020 +0200 patch 8.2.1160: Vim9: memory leak in allocated types Problem: Vim9: memory leak in allocated types. Solution: Free the type pointers.
author Bram Moolenaar <Bram@vim.org>
date Wed, 08 Jul 2020 19:45:04 +0200
parents b0baa80cb53f
children ad13736a1783
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -1069,10 +1069,7 @@ func_clear_items(ufunc_T *fp)
     VIM_CLEAR(fp->uf_arg_types);
     VIM_CLEAR(fp->uf_def_arg_idx);
     VIM_CLEAR(fp->uf_va_name);
-    while (fp->uf_type_list.ga_len > 0)
-	vim_free(((type_T **)fp->uf_type_list.ga_data)
-						  [--fp->uf_type_list.ga_len]);
-    ga_clear(&fp->uf_type_list);
+    clear_type_list(&fp->uf_type_list);
 
 #ifdef FEAT_LUA
     if (fp->uf_cb_free != NULL)