]> granicus.if.org Git - vim/commitdiff
patch 8.2.2882: Vim9: memory leak when lambda has an error v8.2.2882
authorBram Moolenaar <Bram@vim.org>
Mon, 24 May 2021 13:45:29 +0000 (15:45 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 24 May 2021 13:45:29 +0000 (15:45 +0200)
Problem:    Vim9: memory leak when lambda has an error.
Solution:   Free the list of argument types on failure.

src/userfunc.c
src/version.c

index dd6939c9a37779ecf62c8a87b0c24c67896aa265..f5d9063028a7ff9840ee7c77e05016b298ac6bd8 100644 (file)
@@ -1394,7 +1394,11 @@ errret:
     ga_clear_strings(&newlines);
     ga_clear_strings(&default_args);
     if (types_optional)
+    {
        ga_clear_strings(&argtypes);
+       if (fp != NULL)
+           vim_free(fp->uf_arg_types);
+    }
     vim_free(fp);
     vim_free(pt);
     if (evalarg != NULL && evalarg->eval_tofree == NULL)
index 7fb1401122c7a8122e93730fbf53840574797162..378e846f7361ad2d5aaf9d2ee93e1410dcff6bdc 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2882,
 /**/
     2881,
 /**/