Mercurial > vim
changeset 22504:47e15b82dba1 v8.2.1800
patch 8.2.1800: Vim9: memory leak if "if" condition is invalid
Commit: https://github.com/vim/vim/commit/dda749ce85cc07000faa86bfd2ceaecd8e4805fc
Author: Bram Moolenaar <Bram@vim.org>
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 04 Oct 2020 17:30:03 +0200 |
parents | 7717027d6bf6 |
children | 6b21190550ad |
files | src/version.c src/vim9compile.c |
diffstat | 2 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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,
--- 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 {