mirror of
https://github.com/vim/vim.git
synced 2026-05-28 00:21:37 +02:00
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:
committed by
Christian Brabandt
parent
cb031178c2
commit
5aa0860d0a
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
63,
|
||||
/**/
|
||||
62,
|
||||
/**/
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user