To: vim_dev@googlegroups.com Subject: Patch 8.2.3241 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3241 Problem: Vim9: memory leak when function reports an error. Solution: Clear the return value. Files: src/userfunc.c *** ../vim-8.2.3240/src/userfunc.c 2021-07-28 19:34:10.559082899 +0200 --- src/userfunc.c 2021-07-28 22:19:16.536867041 +0200 *************** *** 1691,1699 **** --- 1691,1702 ---- ret = call_func(name, len, rettv, argcount, argvars, funcexe); if (in_vim9script() && did_emsg > did_emsg_before) + { // An error in a builtin function does not return FAIL, but we do // want to abort further processing if an error was given. ret = FAIL; + clear_tv(rettv); + } funcargs.ga_len -= i; } *** ../vim-8.2.3240/src/version.c 2021-07-28 21:48:55.841029431 +0200 --- src/version.c 2021-07-28 22:21:00.524652250 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3241, /**/ -- Edison's greatest achievement came in 1879, when he invented the electric company. Edison's design was a brilliant adaptation of the simple electrical circuit: the electric company sends electricity through a wire to a customer, then immediately gets the electricity back through another wire /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///