diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-10-04 17:24:29 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-10-04 17:24:29 +0200 |
commit | dda749ce85cc07000faa86bfd2ceaecd8e4805fc (patch) | |
tree | 9142d9a2a9e4b12358e449b6ddc33fae642ee41d /src | |
parent | d1ad99b65470d3e754f6a0588a6b0dc2214a1eab (diff) | |
download | vim-git-dda749ce85cc07000faa86bfd2ceaecd8e4805fc.tar.gz |
patch 8.2.1800: Vim9: memory leak if "if" condition is invalidv8.2.1800
Problem: Vim9: memory leak if "if" condition is invalid.
Solution: Free ppconst earlier.
Diffstat (limited to 'src')
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/version.c b/src/version.c index 893e5eb61..d78458941 100644 --- 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 index 8d362ab1d..373d76c6e 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 { |