]> granicus.if.org Git - vim/commitdiff
patch 8.2.0715: Vim9: leaking memory v8.2.0715
authorBram Moolenaar <Bram@vim.org>
Thu, 7 May 2020 20:23:58 +0000 (22:23 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 7 May 2020 20:23:58 +0000 (22:23 +0200)
Problem:    Vim9: leaking memory.
Solution:   Free strings after concatenating them.

src/version.c
src/vim9compile.c

index fd59afd1b6d762a4fa1eb185ce656dd5deee7612..7434486490c9bf45302412632dd46154fe613369 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    715,
 /**/
     714,
 /**/
index 4ebb88062cb61ba606d5b2970fb04747400213e4..3d3b3c30fcca199c3a44dc1fe5f72aa5aef73950 100644 (file)
@@ -4229,6 +4229,8 @@ compile_expr5(char_u **arg, cctx_T *cctx)
            }
            mch_memmove(tv1.vval.v_string, s1, len1);
            STRCPY(tv1.vval.v_string + len1, s2);
+           vim_free(s1);
+           vim_free(s2);
        }
        else
        {