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

@@ -695,6 +695,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 */
/**/
1136,
/**/ /**/
1135, 1135,
/**/ /**/

View File

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