mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
vim-patch:8.2.1971: memory leak when map() fails
Problem: Memory leak when map() fails.
Solution: Clear the typval.
c56936e2ba
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -5217,8 +5217,11 @@ static void filter_map(typval_T *argvars, typval_T *rettv, filtermap_T filtermap
|
||||
}
|
||||
vimvars[VV_KEY].vv_nr = idx;
|
||||
typval_T newtv;
|
||||
if (filter_map_one(TV_LIST_ITEM_TV(li), expr, filtermap, &newtv, &rem) == FAIL
|
||||
|| did_emsg) {
|
||||
if (filter_map_one(TV_LIST_ITEM_TV(li), expr, filtermap, &newtv, &rem) == FAIL) {
|
||||
break;
|
||||
}
|
||||
if (did_emsg) {
|
||||
tv_clear(&newtv);
|
||||
break;
|
||||
}
|
||||
if (filtermap == FILTERMAP_MAP) {
|
||||
|
Reference in New Issue
Block a user