Mercurial > vim
changeset 14264:534836186b15 v8.1.0148
patch 8.1.0148: memory leak when using :tcl expr command
commit https://github.com/vim/vim/commit/92959fa46d305ded1da433ad6d9a8d38db240c74
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 4 22:12:25 2018 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 04 Jul 2018 22:15:07 +0200 |
parents | cdb7b4fd094b |
children | 80ca26dbc054 |
files | src/if_tcl.c src/version.c |
diffstat | 2 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/if_tcl.c +++ b/src/if_tcl.c @@ -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);