From 335e67132265b068f39f3671e5dff2aecd1bf403 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 17 Oct 2020 22:58:21 +0200 Subject: patch 8.2.1860: Vim9: memory leak when throwing empty string Problem: Vim9: memory leak when throwing empty string. Solution: Free the empty string. --- src/version.c | 2 ++ src/vim9execute.c | 1 + 2 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/version.c b/src/version.c index 342ad7cd93..7720998fc1 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1860, /**/ 1859, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index 31b67d183a..673bf91c43 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; } -- cgit v1.2.3