]> granicus.if.org Git - vim/commitdiff
patch 8.2.2835: Vim9: leaking memory in :cexpr v8.2.2835
authorBram Moolenaar <Bram@vim.org>
Wed, 5 May 2021 20:40:56 +0000 (22:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 5 May 2021 20:40:56 +0000 (22:40 +0200)
Problem:    Vim9: leaking memory in :cexpr.
Solution:   Also free the command line copy.

src/version.c
src/vim9compile.c

index 101036f803be1216b92275dddc21f870a0cb7653..9b53528bf95b4828cc3d0ade9982dc99e3e465f3 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2835,
 /**/
     2834,
 /**/
index 607f651d9064d3452a5669b5f246df79fa3d4480..ead193f38e62638ce3e5c6fba5da97276e5cf096 100644 (file)
@@ -9641,6 +9641,7 @@ delete_instr(isn_T *isn)
            break;
 
        case ISN_CEXPR_CORE:
+           vim_free(isn->isn_arg.cexpr.cexpr_ref->cer_cmdline);
            vim_free(isn->isn_arg.cexpr.cexpr_ref);
            break;