Skip to content

Commit 30bac35

Browse files
huanghuihui0904chrisbra
authored andcommitted
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 <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 466b5f5 commit 30bac35

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
268,
737739
/**/
738740
267,
739741
/**/

src/vim9class.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,7 +3099,11 @@ call_oc_method(
30993099
char_u *argp = name_end;
31003100
int ret = get_func_arguments(&argp, evalarg, 0, argvars, &argcount, FALSE);
31013101
if (ret == FAIL)
3102+
{
3103+
while (--argcount >= 0)
3104+
clear_tv(&argvars[argcount]);
31023105
return FAIL;
3106+
}
31033107

31043108
funcexe_T funcexe;
31053109
CLEAR_FIELD(funcexe);

0 commit comments

Comments
 (0)