From 2c7080bf1ceef4a7779644fd428b2386a0676794 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 6 Feb 2021 19:19:42 +0100 Subject: 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. --- src/quickfix.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quickfix.c') diff --git a/src/quickfix.c b/src/quickfix.c index 742a1ee71..910c806f1 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2603,6 +2603,8 @@ qflist_valid(win_T *wp, int_u qf_id) if (wp != NULL) { + if (!win_valid(wp)) + return FALSE; qi = GET_LOC_LIST(wp); // Location list if (qi == NULL) return FALSE; -- cgit v1.2.1