1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar 2020-10-04 17:24:29 +02:00
parent d1ad99b654
commit dda749ce85
2 changed files with 3 additions and 1 deletions

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1800,
/**/
1799,
/**/

View File

@ -5721,10 +5721,10 @@ compile_if(char_u *arg, cctx_T *cctx)
// 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
{