To: vim_dev@googlegroups.com Subject: Patch 8.2.0041 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0041 Problem: Leaking memory when selecting spell suggestion. Solution: Free previous value at the right time. Files: src/spellsuggest.c *** ../vim-8.2.0040/src/spellsuggest.c 2019-12-25 13:55:20.745841469 +0100 --- src/spellsuggest.c 2019-12-25 14:09:01.238870997 +0100 *************** *** 540,553 **** else if (count > 0) { if (count > sug.su_ga.ga_len) ! smsg(_("Sorry, only %ld suggestions"), ! (long)sug.su_ga.ga_len); } else { - VIM_CLEAR(repl_from); - VIM_CLEAR(repl_to); - #ifdef FEAT_RIGHTLEFT // When 'rightleft' is set the list is drawn right-left. cmdmsg_rl = curwin->w_p_rl; --- 540,549 ---- else if (count > 0) { if (count > sug.su_ga.ga_len) ! smsg(_("Sorry, only %ld suggestions"), (long)sug.su_ga.ga_len); } else { #ifdef FEAT_RIGHTLEFT // When 'rightleft' is set the list is drawn right-left. cmdmsg_rl = curwin->w_p_rl; *************** *** 641,646 **** --- 637,645 ---- if (selected > 0 && selected <= sug.su_ga.ga_len && u_save_cursor() == OK) { // Save the from and to text for :spellrepall. + VIM_CLEAR(repl_from); + VIM_CLEAR(repl_to); + stp = &SUG(sug.su_ga, selected - 1); if (sug.su_badlen > stp->st_orglen) { *** ../vim-8.2.0040/src/version.c 2019-12-25 13:59:47.396893396 +0100 --- src/version.c 2019-12-25 14:09:44.798710177 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 41, /**/ -- GUARD #2: It could be carried by an African swallow! GUARD #1: Oh, yeah, an African swallow maybe, but not a European swallow, that's my point. GUARD #2: Oh, yeah, I agree with that... The Quest for the Holy Grail (Monty Python) /// 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 ///