Skip to content

Commit 3dfe2e0

Browse files
committed
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.
1 parent 1a7ee4d commit 3dfe2e0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3443,
758760
/**/
759761
3442,
760762
/**/

src/vim9compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5268,6 +5268,7 @@ compile_and_or(
52685268
{
52695269
semsg(_(e_white_space_required_before_and_after_str_at_str),
52705270
op, p);
5271+
ga_clear(&end_ga);
52715272
return FAIL;
52725273
}
52735274

@@ -5388,8 +5389,8 @@ compile_and_or(
53885389
+ *(((int *)end_ga.ga_data) + end_ga.ga_len);
53895390
isn->isn_arg.jump.jump_where = instr->ga_len;
53905391
}
5391-
ga_clear(&end_ga);
53925392
}
5393+
ga_clear(&end_ga);
53935394

53945395
cctx->ctx_skip = save_skip;
53955396
}

0 commit comments

Comments
 (0)