mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.2661: leaking memory when looping over a string
Problem: Leaking memory when looping over a string.
Solution: Free the memory.
bb5d87c850
This commit is contained in:
parent
7002a3433b
commit
83a48d7a44
@ -2698,7 +2698,10 @@ bool 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, fi->fi_varcount, false, NULL) == OK;
|
||||
const int result
|
||||
= ex_let_vars(arg, &tv, true, fi->fi_semicolon, fi->fi_varcount, false, NULL) == OK;
|
||||
xfree(tv.vval.v_string);
|
||||
return result;
|
||||
}
|
||||
|
||||
listitem_T *item = fi->fi_lw.lw_item;
|
||||
|
Loading…
Reference in New Issue
Block a user