]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0195: memleak with ex_drop, NULL dereference v9.1.0195
authorChristian Brabandt <cb@256bit.org>
Thu, 21 Mar 2024 19:19:00 +0000 (20:19 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 21 Mar 2024 19:19:00 +0000 (20:19 +0100)
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>
src/ex_cmds.c
src/version.c

index 2527476a25055c981e8451defa5e1549ae8a4ce0..864f89d43cffb940f7976fa0df18708b9ef51404 100644 (file)
@@ -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;
        }
     }
index 8a801686f93d12572b27f1b015222d1befd37bbf..bb2980b0b42fdc466722d127d39be5fdf757ac88 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    195,
 /**/
     194,
 /**/