To: vim_dev@googlegroups.com Subject: Patch 8.2.2023 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2023 Problem: Vim: memory leak when :execute fails. Solution: Clear the growarray. Files: src/vim9execute.c *** ../vim-8.2.2022/src/vim9execute.c 2020-11-20 19:26:45.081207924 +0100 --- src/vim9execute.c 2020-11-21 11:43:05.022528437 +0100 *************** *** 1200,1206 **** --- 1200,1209 ---- } ectx.ec_stack.ga_len -= count; if (failed) + { + ga_clear(&ga); goto on_error; + } if (ga.ga_data != NULL) { *************** *** 1209,1215 **** --- 1212,1221 ---- SOURCING_LNUM = iptr->isn_lnum; do_cmdline_cmd((char_u *)ga.ga_data); if (did_emsg) + { + ga_clear(&ga); goto on_error; + } } else { *** ../vim-8.2.2022/src/version.c 2020-11-20 21:06:56.699112617 +0100 --- src/version.c 2020-11-21 11:43:41.762370365 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2023, /**/ -- Facepalm statement #4: "3000 year old graves? That's not possible, it's only 2014!" /// 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 ///