From dda749ce85cc07000faa86bfd2ceaecd8e4805fc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 4 Oct 2020 17:24:29 +0200 Subject: patch 8.2.1800: Vim9: memory leak if "if" condition is invalid Problem: Vim9: memory leak if "if" condition is invalid. Solution: Free ppconst earlier. --- src/version.c | 2 ++ src/vim9compile.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/version.c b/src/version.c index 893e5eb614..d784589419 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1800, /**/ 1799, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index 8d362ab1d0..373d76c6e2 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -5721,10 +5721,10 @@ compile_if(char_u *arg, cctx_T *cctx) // The expression results in a constant. v = tv_get_bool_chk(&ppconst.pp_tv[0], &error); + clear_ppconst(&ppconst); if (error) return NULL; cctx->ctx_skip = v ? SKIP_NOT : SKIP_YES; - clear_ppconst(&ppconst); } else { -- cgit v1.2.3