From 1664e3d4bcc122e6a3b064a3fe20fdc163f6ae9d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 20 Apr 2022 10:05:02 +0800 Subject: vim-patch:8.2.2476: using freed memory when splitting window while closing buffer Problem: Using freed memory when using an autocommand to split a window while a buffer is being closed. Solution: Disallow splitting when the buffer has b_locked_split set. https://github.com/vim/vim/commit/983d83ff1cd796ff321074335fa53fbe7ac45a46 Put the error message in window.c. Cherry-pick a memory leak fix from Vim patch 8.2.0399. Test still fails. --- src/nvim/ex_getln.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/ex_getln.c') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 91e93a236a..b7d75855d6 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -6376,6 +6376,7 @@ static int open_cmdwin(void) // Create a window for the command-line buffer. if (win_split((int)p_cwh, WSP_BOT) == FAIL) { beep_flush(); + ga_clear(&winsizes); return K_IGNORE; } cmdwin_type = get_cmdline_type(); -- cgit