0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.1860: Vim9: memory leak when throwing empty string

Problem:    Vim9: memory leak when throwing empty string.
Solution:   Free the empty string.
This commit is contained in:
Bram Moolenaar 2020-10-17 22:58:21 +02:00
parent 352134bbfb
commit 335e671322
2 changed files with 3 additions and 0 deletions

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1860,
/**/ /**/
1859, 1859,
/**/ /**/

View File

@ -2094,6 +2094,7 @@ call_def_function(
if (tv->vval.v_string == NULL if (tv->vval.v_string == NULL
|| *skipwhite(tv->vval.v_string) == NUL) || *skipwhite(tv->vval.v_string) == NUL)
{ {
vim_free(tv->vval.v_string);
emsg(_(e_throw_with_empty_string)); emsg(_(e_throw_with_empty_string));
goto failed; goto failed;
} }