From 983d83ff1cd796ff321074335fa53fbe7ac45a46 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 7 Feb 2021 12:12:43 +0100 Subject: 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. --- src/structs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/structs.h') diff --git a/src/structs.h b/src/structs.h index 6cdfb4fc5..8d86d11b1 100644 --- a/src/structs.h +++ b/src/structs.h @@ -2633,6 +2633,8 @@ struct file_buffer int b_flags; // various BF_ flags int b_locked; // Buffer is being closed or referenced, don't // let autocommands wipe it out. + int b_locked_split; // Buffer is being closed, don't allow opening + // a new window with it. /* * b_ffname has the full path of the file (NULL for no name). -- cgit v1.2.1