patch 9.2.0063: memory leak in type_name_list_or_dict()

Problem:  memory leak in type_name_list_or_dict()
Solution: Free the variable member_free on early returns (Huihui Huang).

closes: #19513

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Huihui Huang
2026-02-26 20:41:11 +00:00
committed by Christian Brabandt
parent cb031178c2
commit 5aa0860d0a
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
63,
/**/
62,
/**/
+3
View File
@@ -2573,7 +2573,10 @@ type_name_list_or_dict(char *name, type_T *type, char **tofree)
size_t len = STRLEN(name) + STRLEN(member_name) + 3;
*tofree = alloc(len);
if (*tofree == NULL)
{
vim_free(member_free);
return name;
}
vim_snprintf(*tofree, len, "%s<%s>", name, member_name);
vim_free(member_free);