0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3429: leaking memory when assigning to list or dict

Problem:    Leaking memory when assigning to list or dict.
Solution:   Free the list or dict type before overwriting it.
This commit is contained in:
Bram Moolenaar
2021-09-11 23:07:44 +02:00
parent 35a9a00afc
commit 464393a696
3 changed files with 19 additions and 3 deletions

View File

@@ -258,7 +258,7 @@ func_type_add_arg_types(
typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int do_member)
{
type_T *type;
type_T *member_type = &t_any;
type_T *member_type = NULL;
int argcount = 0;
int min_argcount = 0;
@@ -268,6 +268,8 @@ typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int do_member)
return &t_bool;
if (tv->v_type == VAR_STRING)
return &t_string;
if (tv->v_type == VAR_BLOB)
return &t_blob;
if (tv->v_type == VAR_LIST)
{