From 69ac382a283c92c54fc40b0017688a60fe89a49c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 20 Apr 2022 09:44:12 +0800 Subject: vim-patch:8.2.2474: using freed memory when window is closed by autocommand Problem: Using freed memory when window is closed by autocommand. (houyunsong) Solution: Check the window pointer is still valid. https://github.com/vim/vim/commit/2c7080bf1ceef4a7779644fd428b2386a0676794 Add missing comment from Vim patch 8.0.1420. Test fails. --- src/nvim/quickfix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/nvim/quickfix.c') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index f8d2d37a91..a12fb70388 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2313,7 +2313,10 @@ static bool qflist_valid(win_T *wp, unsigned int qf_id) qf_info_T *qi = &ql_info; if (wp) { - qi = GET_LOC_LIST(wp); + if (!win_valid(wp)) { + return false; + } + qi = GET_LOC_LIST(wp); // Location list if (!qi) { return false; } -- cgit