changeset 25816:d9a0847550c6 v8.2.3443

patch 8.2.3443: Vim9: memory leak when and/or fails Commit: https://github.com/vim/vim/commit/3dfe2e0fb8768914a019fa04b1ed9581e33c9b26 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 16 20:14:51 2021 +0200 patch 8.2.3443: Vim9: memory leak when and/or fails Problem: Vim9: memory leak when and/or fails. Solution: Also clear the growarray when the length is zero.
author Bram Moolenaar <Bram@vim.org>
date Thu, 16 Sep 2021 20:15:04 +0200
parents e41747c63ed5
children bac65c7d2d22
files src/version.c src/vim9compile.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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,
--- 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;
     }