]> granicus.if.org Git - vim/commitdiff
patch 8.2.3443: Vim9: memory leak when and/or fails v8.2.3443
authorBram Moolenaar <Bram@vim.org>
Thu, 16 Sep 2021 18:14:51 +0000 (20:14 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 16 Sep 2021 18:14:51 +0000 (20:14 +0200)
Problem:    Vim9: memory leak when and/or fails.
Solution:   Also clear the growarray when the length is zero.

src/version.c
src/vim9compile.c

index ba2b475ca9f7198161e1f7e90b8927512aba3d65..4d559248e5c59701f181ec11c9d99483826906bd 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3443,
 /**/
     3442,
 /**/
index 0d64f0134d279403bc586f8ea586d31cc6885b16..e9931731cd4ba67fb3ed9175dcdd43b93bb29031 100644 (file)
@@ -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;
     }