1
0
forked from aniani/vim

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 <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2024-03-21 20:19:00 +01:00
parent 9eb236f455
commit 85a769d466
2 changed files with 4 additions and 2 deletions

View 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;
}
}

View File

@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
195,
/**/
194,
/**/