summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-17 22:58:21 +0200
committerBram Moolenaar <Bram@vim.org>2020-10-17 22:58:21 +0200
commit335e67132265b068f39f3671e5dff2aecd1bf403 (patch)
tree4ab954fd4cc9d86792207844a17c6f5de169acac
parent352134bbfbff4831a3f6a3383d9e2d8660016243 (diff)
downloadvim-git-335e67132265b068f39f3671e5dff2aecd1bf403.tar.gz
patch 8.2.1860: Vim9: memory leak when throwing empty stringv8.2.1860
Problem: Vim9: memory leak when throwing empty string. Solution: Free the empty string.
-rw-r--r--src/version.c2
-rw-r--r--src/vim9execute.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/version.c b/src/version.c
index 342ad7cd9..7720998fc 100644
--- 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,
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 31b67d183..673bf91c4 100644
--- 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;
}