1
0
forked from aniani/vim

patch 8.2.2661: leaking memory when looping over a string

Problem:    Leaking memory when looping over a string.
Solution:   Free the memory.
This commit is contained in:
Bram Moolenaar
2021-03-26 22:15:26 +01:00
parent ccc25aa285
commit bb5d87c850
2 changed files with 5 additions and 1 deletions

View File

@@ -1815,8 +1815,10 @@ next_for_item(void *fi_void, char_u *arg)
tv.v_lock = VAR_FIXED;
tv.vval.v_string = vim_strnsave(fi->fi_string + fi->fi_byte_idx, len);
fi->fi_byte_idx += len;
return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
result = ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
fi->fi_varcount, flag, NULL) == OK;
vim_free(tv.vval.v_string);
return result;
}
item = fi->fi_lw.lw_item;

View File

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