]> granicus.if.org Git - vim/commitdiff
patch 8.2.2279: Vim9: memory leak with catch in skipped block v8.2.2279
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Jan 2021 17:17:26 +0000 (18:17 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Jan 2021 17:17:26 +0000 (18:17 +0100)
Problem:    Vim9: memory leak with catch in skipped block.
Solution:   Free the pattern if not used.

src/version.c
src/vim9compile.c

index af74bcbbad0a4f850887f7e089e50988d9959beb..a4149c6f868025b9dc5b6223d5ed8362b0bd91ed 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2279,
 /**/
     2278,
 /**/
index bb33d38e9ef0d0be6f1e948ce85dcf7de7bfc92e..23da8f2d11cd6b9c1edee0b17bbc19250a14a0e8 100644 (file)
@@ -1009,7 +1009,11 @@ generate_PUSHS(cctx_T *cctx, char_u *str)
 {
     isn_T      *isn;
 
-    RETURN_OK_IF_SKIP(cctx);
+    if (cctx->ctx_skip == SKIP_YES)
+    {
+       vim_free(str);
+       return OK;
+    }
     if ((isn = generate_instr_type(cctx, ISN_PUSHS, &t_string)) == NULL)
        return FAIL;
     isn->isn_arg.string = str;