mirror of
https://github.com/neovim/neovim.git
synced 2026-10-26 15:40:20 -05:00
vim-patch:9.1.1573: Memory leak when pressing Ctrl-D in cmdline mode
Problem: Memory leak when pressing Ctrl-D in cmdline mode
(after 9.1.1571).
Solution: Free prev_cmdbuff before assigning to it.
(zeertzjq).
Existing tests already cover this. This change fixes the CI failure.
closes: vim/vim#17807
https://github.com/vim/vim/commit/c02bef26fdfbffd442cbc5acef375256fa7fd6ff
This commit is contained in:
1 parent
bbc368dfce
commit
22d1fb8c01
1 file changed
+2
-3
+2
-3
@@ -1021,7 +1021,9 @@ theend:
|
||||
static int command_line_check(VimState *state)
|
||||
{
|
||||
CommandLineState *s = (CommandLineState *)state;
|
||||
|
||||
s->prev_cmdpos = ccline.cmdpos;
|
||||
XFREE_CLEAR(s->prev_cmdbuff);
|
||||
|
||||
redir_off = true; // Don't redirect the typed command.
|
||||
// Repeated, because a ":redir" inside
|
||||
@@ -2309,7 +2311,6 @@ static int command_line_not_changed(CommandLineState *s)
|
||||
// changed in the past.
|
||||
// Enter command_line_changed() when the command line did change.
|
||||
if (!s->is_state.incsearch_postponed) {
|
||||
XFREE_CLEAR(s->prev_cmdbuff);
|
||||
return 1;
|
||||
}
|
||||
return command_line_changed(s);
|
||||
@@ -2787,8 +2788,6 @@ static int command_line_changed(CommandLineState *s)
|
||||
do_autocmd_cmdlinechanged(s->firstc > 0 ? s->firstc : '-');
|
||||
}
|
||||
|
||||
XFREE_CLEAR(s->prev_cmdbuff);
|
||||
|
||||
may_trigger_cursormovedc(s);
|
||||
|
||||
const bool prev_cmdpreview = cmdpreview;
|
||||
|
||||
Reference in new issue
Block a user