]> granicus.if.org Git - vim/commitdiff
patch 9.0.0556: leaking memory with nested functions v9.0.0556
authorBram Moolenaar <Bram@vim.org>
Fri, 23 Sep 2022 12:27:57 +0000 (13:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 23 Sep 2022 12:27:57 +0000 (13:27 +0100)
Problem:    Leaking memory with nested functions.
Solution:   Free saved pointer.

src/eval.c
src/version.c

index bdf03896a450190053473d250e53a55313fbf460..d369df5e01d17ee36e703f7c6b6dca59bf8854dd 100644 (file)
@@ -400,6 +400,7 @@ clear_evalarg(evalarg_T *evalarg, exarg_T *eap)
                    // need to keep it around.
                    --etga->ga_len;
                    *eap->cmdlinep = ((char_u **)etga->ga_data)[etga->ga_len];
+                   vim_free(evalarg->eval_tofree);
                }
                else
                    *eap->cmdlinep = evalarg->eval_tofree;
index 617b76c2f3e487d25646287c90ad3333cf756a56..8df30bd161942fcfb17eb8bf6561a53f84c27581 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    556,
 /**/
     555,
 /**/