# HG changeset patch # User Bram Moolenaar # Date 1602968403 -7200 # Node ID 672ee41a6a3bf2733e99a7cc48aa268c697bfac1 # Parent cd4e2b566907b019dba1ce7656bb492fa7480f0c patch 8.2.1860: Vim9: memory leak when throwing empty string Commit: https://github.com/vim/vim/commit/335e67132265b068f39f3671e5dff2aecd1bf403 Author: Bram Moolenaar 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. diff --git a/src/version.c b/src/version.c --- 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 --- 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; }