patch 8.2.1800: Vim9: memory leak if "if" condition is invalid
Problem: Vim9: memory leak if "if" condition is invalid.
Solution: Free ppconst earlier.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 8d362ab..373d76c 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -5721,10 +5721,10 @@
// The expression results in a constant.
v = tv_get_bool_chk(&ppconst.pp_tv[0], &error);
+ clear_ppconst(&ppconst);
if (error)
return NULL;
cctx->ctx_skip = v ? SKIP_NOT : SKIP_YES;
- clear_ppconst(&ppconst);
}
else
{