]> granicus.if.org Git - vim/commitdiff
patch 8.2.2748: Vim9: memory leak when calling :def function fails v8.2.2748
authorBram Moolenaar <Bram@vim.org>
Sat, 10 Apr 2021 18:46:48 +0000 (20:46 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 10 Apr 2021 18:46:48 +0000 (20:46 +0200)
Problem:    Vim9: memory leak when calling :def function fails.
Solution:   Jump to failed_early instead of returning.

src/version.c
src/vim9execute.c

index 9fca01a86d34d9fa4d86c993937828393d21da6f..fa3a9a8c652cba812c464368c81b37769efc1f33 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2748,
 /**/
     2747,
 /**/
index e7885ad70081d678239ea0d237b9d064c5b122bd..017d5774efc97613fa14d0264c7da1ae285b0963 100644 (file)
@@ -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.