changeset 22623:672ee41a6a3b v8.2.1860

patch 8.2.1860: Vim9: memory leak when throwing empty string Commit: https://github.com/vim/vim/commit/335e67132265b068f39f3671e5dff2aecd1bf403 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 17 22:58:21 2020 +0200 patch 8.2.1860: Vim9: memory leak when throwing empty string Problem: Vim9: memory leak when throwing empty string. Solution: Free the empty string.
author Bram Moolenaar <Bram@vim.org>
date Sat, 17 Oct 2020 23:00:03 +0200
parents cd4e2b566907
children d2b721a599f9
files src/version.c src/vim9execute.c
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1860,
+/**/
     1859,
 /**/
     1858,
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -2094,6 +2094,7 @@ call_def_function(
 		if (tv->vval.v_string == NULL
 				       || *skipwhite(tv->vval.v_string) == NUL)
 		{
+		    vim_free(tv->vval.v_string);
 		    emsg(_(e_throw_with_empty_string));
 		    goto failed;
 		}