patch 8.1.0148: memory leak when using :tcl expr command v8.1.0148
authorBram Moolenaar <Bram@vim.org>
Wed, 4 Jul 2018 20:12:25 +0000 (22:12 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 4 Jul 2018 20:12:25 +0000 (22:12 +0200)
Problem:    Memory leak when using :tcl expr command.
Solution:   Free the result of expression evaluation. (Dominique Pelle,
            closes #3150)

src/if_tcl.c
src/version.c

index 690c6392b13c6214a1a7fa134328fb4285c4b253..9ecabf84c5e58922f7876b2193bc7a857f1c7fa3 100644 (file)
@@ -1385,7 +1385,10 @@ tclvimexpr(
     if (str == NULL)
        Tcl_SetResult(interp, _("invalid expression"), TCL_STATIC);
     else
+    {
        Tcl_SetResult(interp, str, TCL_VOLATILE);
+       vim_free(str);
+    }
     err = vimerror(interp);
 #else
     Tcl_SetResult(interp, _("expressions disabled at compile time"), TCL_STATIC);
index 08a2e0409c6d0e526fd29c8f958d4a8c1b40a2c4..156e8dcf39be0515d2c790ffc03e8794af06c6e1 100644 (file)
@@ -789,6 +789,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    148,
 /**/
     147,
 /**/