mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
vim-patch:9.1.1331: Leaking memory with cmdcomplete()
Problem: Leaking memory with cmdcomplete()
(zeertzjq, after v9.1.1329)
Solution: free the memory (Girish Palya)
closes: vim/vim#17190
5c3d1e3258
Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
@ -1065,6 +1065,7 @@ int showmatches(expand_T *xp, bool wildmenu)
|
||||
|
||||
// Save cmdline before expansion
|
||||
if (ccline->cmdbuff != NULL) {
|
||||
xfree(cmdline_orig);
|
||||
cmdline_orig = xstrnsave(ccline->cmdbuff, (size_t)ccline->cmdlen);
|
||||
}
|
||||
|
||||
|
@ -1279,7 +1279,7 @@ M.funcs = {
|
||||
name = 'cmdcomplete_info',
|
||||
params = {},
|
||||
returns = 'table<string,any>',
|
||||
signature = 'cmdcomplete_info([{what}])',
|
||||
signature = 'cmdcomplete_info()',
|
||||
},
|
||||
col = {
|
||||
args = { 1, 2 },
|
||||
|
@ -1302,8 +1302,8 @@ static int command_line_execute(VimState *state, int key)
|
||||
}
|
||||
|
||||
// Trigger CmdlineLeavePre autocommand
|
||||
if (ccline.cmdfirstc != NUL && (s->c == '\n' || s->c == '\r' || s->c == K_KENTER
|
||||
|| s->c == ESC || s->c == Ctrl_C)) {
|
||||
if (s->c == '\n' || s->c == '\r' || s->c == K_KENTER
|
||||
|| s->c == ESC || s->c == Ctrl_C) {
|
||||
trigger_cmd_autocmd(get_cmdline_type(), EVENT_CMDLINELEAVEPRE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user