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.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 0d64f01..e993173 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -5268,6 +5268,7 @@
{
semsg(_(e_white_space_required_before_and_after_str_at_str),
op, p);
+ ga_clear(&end_ga);
return FAIL;
}
@@ -5388,8 +5389,8 @@
+ *(((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;
}