eval: Fix memory leak

Ref vim/vim#1497
This commit is contained in:
ZyX 2017-02-20 23:12:33 +03:00
parent 3277eff31a
commit 7869b978e8

View File

@ -2190,8 +2190,11 @@ get_lval (
if (len == -1)
clear_tv(&var1);
break;
// existing variable, need to check if it can be changed
} else if (var_check_ro(lp->ll_di->di_flags, name, false)) {
// existing variable, need to check if it can be changed
if (len == -1) {
clear_tv(&var1);
}
return NULL;
}