diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-12 17:11:27 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-12 17:11:27 +0200 |
commit | c5f1ef53c24cc0c9f7b2131609e916f913634feb (patch) | |
tree | 0418dd550fa95633038adca23b01db6029d2d34a /src/vim9compile.c | |
parent | 4fdae9996fb9a9bc1291a61e7b85cb360feb7599 (diff) |
patch 8.2.0556: Vim9: memory leak when finding common typev8.2.0556
Problem: Vim9: memory leak when finding common type.
Solution: Store allocated memory in type growarray.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r-- | src/vim9compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c index 8d536eb089..cf91d3bb37 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -1823,8 +1823,8 @@ common_type(type_T *type1, type_T *type2, type_T **dest, garray_T *type_gap) *dest = alloc_func_type(common, argcount, type_gap); if (type1->tt_args != NULL && type2->tt_args != NULL) { - (*dest)->tt_args = ALLOC_CLEAR_MULT(type_T *, argcount); - if ((*dest)->tt_args != NULL) + if (func_type_add_arg_types(*dest, argcount, + type_gap) == OK) for (i = 0; i < argcount; ++i) common_type(type1->tt_args[i], type2->tt_args[i], &(*dest)->tt_args[i], type_gap); |