1
0
forked from aniani/vim

patch 9.0.1136: memory leak when getting class member type from expr

Problem:    Memory leak when getting class member type from expr.
Solution:   Clear the expression result.
This commit is contained in:
Bram Moolenaar
2023-01-02 21:04:04 +00:00
parent 03ff0c6681
commit e83c133eb9
2 changed files with 5 additions and 0 deletions

View File

@@ -99,8 +99,11 @@ parse_member(
int res = eval0(expr, &tv, eap, &evalarg);
if (res == OK)
{
type = typval2type(&tv, get_copyID(), type_list,
TVTT_DO_MEMBER);
clear_tv(&tv);
}
if (type == NULL)
{
semsg(_(e_cannot_get_object_member_type_from_initializer_str),