changeset 23473:ad83c0ff34c0 v8.2.2279

patch 8.2.2279: Vim9: memory leak with catch in skipped block Commit: https://github.com/vim/vim/commit/508b5618ec0bc6d1edff71e04d99280a2a51df9d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 2 18:17:26 2021 +0100 patch 8.2.2279: Vim9: memory leak with catch in skipped block Problem: Vim9: memory leak with catch in skipped block. Solution: Free the pattern if not used.
author Bram Moolenaar <Bram@vim.org>
date Sat, 02 Jan 2021 18:30:03 +0100
parents 55cfcf83ae29
children e4906ec48336
files src/version.c src/vim9compile.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2279,
+/**/
     2278,
 /**/
     2277,
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -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;