1
0
forked from aniani/vim

patch 8.2.1971: memory leak when map() fails

Problem:    Memory leak when map() fails.
Solution:   Clear the typval.
This commit is contained in:
Bram Moolenaar
2020-11-10 11:43:56 +01:00
parent f883508e36
commit c56936e2ba
2 changed files with 8 additions and 1 deletions

View File

@@ -2185,8 +2185,13 @@ filter_map(typval_T *argvars, typval_T *rettv, filtermap_T filtermap)
nli = li->li_next;
set_vim_var_nr(VV_KEY, idx);
if (filter_map_one(&li->li_tv, expr, filtermap,
&newtv, &rem) == FAIL || did_emsg)
&newtv, &rem) == FAIL)
break;
if (did_emsg)
{
clear_tv(&newtv);
break;
}
if (filtermap == FILTERMAP_MAP)
{
// map(): replace the list item value

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1971,
/**/
1970,
/**/