0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.1.0148: memory leak when using :tcl expr command

Problem:    Memory leak when using :tcl expr command.
Solution:   Free the result of expression evaluation. (Dominique Pelle,
            closes #3150)
This commit is contained in:
Bram Moolenaar
2018-07-04 22:12:25 +02:00
parent 3b48b11c07
commit 92959fa46d
2 changed files with 5 additions and 0 deletions

View 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);