# HG changeset patch # User Bram Moolenaar # Date 1601825403 -7200 # Node ID 47e15b82dba113693f85f21f5e177b79ce965f76 # Parent 7717027d6bf66ec95ad5b01008a8235b65a45855 patch 8.2.1800: Vim9: memory leak if "if" condition is invalid Commit: https://github.com/vim/vim/commit/dda749ce85cc07000faa86bfd2ceaecd8e4805fc Author: Bram Moolenaar Date: Sun Oct 4 17:24:29 2020 +0200 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. diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1800, +/**/ 1799, /**/ 1798, diff --git a/src/vim9compile.c b/src/vim9compile.c --- 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 {