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 -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/201912251314.xBPDEH5K011743%40masaka.moolenaar.net.