]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0067: memory leak in dict_extend_func() v9.2.0067
authorHuihui Huang <625173@qq.com>
Thu, 26 Feb 2026 21:13:40 +0000 (21:13 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 26 Feb 2026 21:13:40 +0000 (21:13 +0000)
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>
src/dict.c
src/version.c

index d83024a97fe00d8566bd28ebca7dfe768262df3f..85e451ec7161ebad7e8e27b85b35a850a221ab3c 100644 (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)
index 6402b27b46cd452e6991128d95dbf52ef4efb1a1..d6194a980145c3adc2e443f20a3239c5cf281de3 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    67,
 /**/
     66,
 /**/