mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -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:
@@ -1385,7 +1385,10 @@ tclvimexpr(
|
|||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
Tcl_SetResult(interp, _("invalid expression"), TCL_STATIC);
|
Tcl_SetResult(interp, _("invalid expression"), TCL_STATIC);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Tcl_SetResult(interp, str, TCL_VOLATILE);
|
Tcl_SetResult(interp, str, TCL_VOLATILE);
|
||||||
|
vim_free(str);
|
||||||
|
}
|
||||||
err = vimerror(interp);
|
err = vimerror(interp);
|
||||||
#else
|
#else
|
||||||
Tcl_SetResult(interp, _("expressions disabled at compile time"), TCL_STATIC);
|
Tcl_SetResult(interp, _("expressions disabled at compile time"), TCL_STATIC);
|
||||||
|
@@ -789,6 +789,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
148,
|
||||||
/**/
|
/**/
|
||||||
147,
|
147,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user