1
0
forked from aniani/vim

patch 8.2.0974: Vim9: memory leak when script var has wrong type

Problem:    Vim9: memory leak when script var has wrong type.
Solution:   Free the variable name.
This commit is contained in:
Bram Moolenaar
2020-06-13 19:56:38 +02:00
parent 34db91f7a4
commit f3decc5830
2 changed files with 5 additions and 0 deletions

View File

@@ -477,7 +477,10 @@ vim9_declare_scriptvar(exarg_T *eap, char_u *arg)
p = skipwhite(p + 1);
type = parse_type(&p, &si->sn_type_list);
if (called_emsg != called_emsg_before)
{
vim_free(name);
return p;
}
// Create the variable with 0/NULL value.
CLEAR_FIELD(init_tv);