To: vim_dev@googlegroups.com Subject: Patch 8.2.3927 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3927 Problem: Vim9: double free when using lambda. Solution: Don't free both cmdline and line_to_free. Files: src/userfunc.c *** ../vim-8.2.3926/src/userfunc.c 2021-12-28 17:55:22.963786520 +0000 --- src/userfunc.c 2021-12-28 20:13:32.463720698 +0000 *************** *** 1146,1152 **** ga_init2(&newlines, (int)sizeof(char_u *), 10); if (get_function_body(&eap, &newlines, NULL, &line_to_free) == FAIL) { ! vim_free(cmdline); goto erret; } --- 1146,1153 ---- ga_init2(&newlines, (int)sizeof(char_u *), 10); if (get_function_body(&eap, &newlines, NULL, &line_to_free) == FAIL) { ! if (cmdline != line_to_free) ! vim_free(cmdline); goto erret; } *** ../vim-8.2.3926/src/version.c 2021-12-28 20:03:38.980797969 +0000 --- src/version.c 2021-12-28 20:18:34.763023710 +0000 *************** *** 751,752 **** --- 751,754 ---- { /* Add new patch number below this line */ + /**/ + 3927, /**/ -- In a world without fences, who needs Gates and Windows? /// 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 ///