diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-09-16 20:14:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-09-16 20:14:51 +0200 |
commit | 3dfe2e0fb8768914a019fa04b1ed9581e33c9b26 (patch) | |
tree | fbf00faaf3d7b33b023cf2643117c7e233404772 | |
parent | 1a7ee4dd115329052670d7af176341bd09c9dc5a (diff) | |
download | vim-git-3dfe2e0fb8768914a019fa04b1ed9581e33c9b26.tar.gz |
patch 8.2.3443: Vim9: memory leak when and/or failsv8.2.3443
Problem: Vim9: memory leak when and/or fails.
Solution: Also clear the growarray when the length is zero.
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/version.c b/src/version.c index ba2b475ca..4d559248e 100644 --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3443, +/**/ 3442, /**/ 3441, diff --git a/src/vim9compile.c b/src/vim9compile.c index 0d64f0134..e9931731c 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -5268,6 +5268,7 @@ compile_and_or( { semsg(_(e_white_space_required_before_and_after_str_at_str), op, p); + ga_clear(&end_ga); return FAIL; } @@ -5388,8 +5389,8 @@ compile_and_or( + *(((int *)end_ga.ga_data) + end_ga.ga_len); isn->isn_arg.jump.jump_where = instr->ga_len; } - ga_clear(&end_ga); } + ga_clear(&end_ga); cctx->ctx_skip = save_skip; } |