patch 9.2.0268: memory leak in call_oc_method()

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>
This commit is contained in:
Huihui Huang
2026-03-29 13:56:42 +00:00
committed by Christian Brabandt
parent 466b5f531a
commit 30bac359dc
2 changed files with 6 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 */
/**/
268,
/**/
267,
/**/
+4
View 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);