To: vim_dev@googlegroups.com Subject: Patch 8.2.2205 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2205 Problem: Vim9: memory leak when parsing lambda fails. Solution: Clear growarrays. Files: src/userfunc.c *** ../vim-8.2.2204/src/userfunc.c 2020-12-24 15:13:35.850860411 +0100 --- src/userfunc.c 2020-12-24 16:04:42.688125597 +0100 *************** *** 523,529 **** --- 523,533 ---- types_optional ? &argtypes : NULL, types_optional, NULL, NULL, TRUE, NULL, NULL); if (ret == FAIL || skip_arrow(s, equal_arrow) == NULL) + { + if (types_optional) + ga_clear_strings(&argtypes); return NOTDONE; + } // Parse the arguments again. if (evaluate) *************** *** 535,541 **** --- 539,549 ---- types_optional ? &argtypes : NULL, types_optional, &varargs, NULL, FALSE, NULL, NULL); if (ret == FAIL || (*arg = skip_arrow(*arg, equal_arrow)) == NULL) + { + if (types_optional) + ga_clear_strings(&argtypes); return NOTDONE; + } // Set up a flag for checking local variables and arguments. if (evaluate) *** ../vim-8.2.2204/src/version.c 2020-12-24 15:13:35.850860411 +0100 --- src/version.c 2020-12-24 15:43:26.016611665 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2205, /**/ -- hundred-and-one symptoms of being an internet addict: 27. You refer to your age as 3.x. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///