]> granicus.if.org Git - vim/commitdiff
patch 8.2.1800: Vim9: memory leak if "if" condition is invalid v8.2.1800
authorBram Moolenaar <Bram@vim.org>
Sun, 4 Oct 2020 15:24:29 +0000 (17:24 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 4 Oct 2020 15:24:29 +0000 (17:24 +0200)
Problem:    Vim9: memory leak if "if" condition is invalid.
Solution:   Free ppconst earlier.

src/version.c
src/vim9compile.c

index 893e5eb614627c1e4efae79547b4e5fa249cc239..d7845894193d1a5278d1d0f852245e2ce4497be1 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1800,
 /**/
     1799,
 /**/
index 8d362ab1d09872ec89b70606ea187f51e2899ad2..373d76c6e21c41bcdd65db5584da96a14bc7b1e0 100644 (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
     {