Skip to content

Commit

Permalink
patch 8.2.2748: Vim9: memory leak when calling :def function fails
Browse files Browse the repository at this point in the history
Problem:    Vim9: memory leak when calling :def function fails.
Solution:   Jump to failed_early instead of returning.
  • Loading branch information
brammool committed Apr 10, 2021
1 parent bb8a7ce commit c429769
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2748,
/**/
2747,
/**/
Expand Down
2 changes: 1 addition & 1 deletion src/vim9execute.c
Expand Up @@ -1343,7 +1343,7 @@ call_def_function(
emsg(_(e_one_argument_too_many));
else
semsg(_(e_nr_arguments_too_many), idx);
return FAIL;
goto failed_early;
}

// Put arguments on the stack, but no more than what the function expects.
Expand Down

0 comments on commit c429769

Please sign in to comment.