From 85a769d466d2009db6a318fd120d9691344664ba Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Thu, 21 Mar 2024 20:19:00 +0100 Subject: patch 9.1.0195: memleak with ex_drop, NULL dereference Problem: memleak with ex_drop(), NULL dereference (zeertzjq) Solution: revert back to ex_rewind(), use curbuf instead of buf fixes: #14246 closes: #14251 Signed-off-by: Christian Brabandt --- src/ex_cmds.c | 4 ++-- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 2527476a25..864f89d43c 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -5503,8 +5503,8 @@ ex_drop(exarg_T *eap) buf_check_timestamp(curbuf, FALSE); curbuf->b_p_ar = save_ar; } - if (buf->b_ml.ml_flags & ML_EMPTY) - open_buffer(FALSE, eap, 0); + if (curbuf->b_ml.ml_flags & ML_EMPTY) + ex_rewind(eap); return; } } diff --git a/src/version.c b/src/version.c index 8a801686f9..bb2980b0b4 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 195, /**/ 194, /**/ -- cgit v1.2.3