patch 9.2.0067: memory leak in dict_extend_func()

Problem:  memory leak in dict_extend_func()
Solution: Free d1 on early return (Huihui Huang)

closes: #19518

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 21:13:40 +00:00
committed by Christian Brabandt
parent c0740e046e
commit 8ba12766d1
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -1370,7 +1370,11 @@ dict_extend_func(
if (type != NULL && check_typval_arg_type(type, &argvars[1],
func_name, 2) == FAIL)
{
if (is_new)
dict_unref(d1);
return;
}
dict_extend(d1, d2, action, func_name);
if (is_new)
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
67,
/**/
66,
/**/