]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0268: memory leak in call_oc_method() v9.2.0268
authorHuihui Huang <625173@qq.com>
Sun, 29 Mar 2026 13:56:42 +0000 (13:56 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 29 Mar 2026 13:56:42 +0000 (13:56 +0000)
Problem:  memory leak in call_oc_method()
Solution: Clean up argvars in the failure case
          (Huihui Huang)

closes: #19828

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/version.c
src/vim9class.c

index d2797c2373918348a715c80a22d874c9d2a94338..82172b749958ab965ba51a02437f6a31ee620e2f 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    268,
 /**/
     267,
 /**/
index 11696b72b6278f0f11a4d64fafbd60c34ef5c820..8edd022bd91e52f923ea7acef18efd98c9ac5302 100644 (file)
@@ -3099,7 +3099,11 @@ call_oc_method(
     char_u *argp = name_end;
     int ret = get_func_arguments(&argp, evalarg, 0, argvars, &argcount, FALSE);
     if (ret == FAIL)
+    {
+       while (--argcount >= 0)
+           clear_tv(&argvars[argcount]);
        return FAIL;
+    }
 
     funcexe_T funcexe;
     CLEAR_FIELD(funcexe);