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:
@@ -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;
|
||||
|
||||
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2661,
|
||||
/**/
|
||||
2660,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user