diff options
author | Christian Brabandt <cb@256bit.org> | 2024-03-21 20:19:00 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-03-21 20:19:00 +0100 |
commit | 85a769d466d2009db6a318fd120d9691344664ba (patch) | |
tree | 415b0f9d9c89f8c4c6c22241d39755d7585bf46f /src/ex_cmds.c | |
parent | 9eb236f455df75af858a37a3d98f190c977deaf4 (diff) |
patch 9.1.0195: memleak with ex_drop, NULL dereferencev9.1.0195
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 <cb@256bit.org>
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 4 |
1 files changed, 2 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; } } |