Patch 8.1.2406
Problem:    Leaking memory in test_paste and test_registers.
Solution:   Free the old title.  Don't copy expr_line.
Files:      src/term.c, src/os_unix.c, src/register.c


*** ../vim-8.1.2405/src/term.c  2019-12-05 21:33:12.322868099 +0100
--- src/term.c  2019-12-07 17:34:32.427447481 +0100
***************
*** 2106,2111 ****
--- 2106,2113 ----
  {
      int           i;
  
+     // Note: Valgrind may report a leak here, because the library keeps one
+     // buffer around that we can't ever free.
      i = TGETENT(tbuf, term);
      if (i < 0             // -1 is always an error
  # ifdef TGETENT_ZERO_ERR
*** ../vim-8.1.2405/src/os_unix.c       2019-12-05 20:28:43.352760457 +0100
--- src/os_unix.c       2019-12-07 17:38:44.310807816 +0100
***************
*** 1963,1968 ****
--- 1963,1972 ----
            retval = TRUE;
            if (!test_only)
            {
+               if (get_title)
+                   vim_free(oldtitle);
+               else
+                   vim_free(oldicon);
                if (text_prop.encoding == XA_STRING && !has_mbyte)
                {
                    if (get_title)
*** ../vim-8.1.2405/src/register.c      2019-12-01 18:16:14.553582042 +0100
--- src/register.c      2019-12-07 17:44:58.149617507 +0100
***************
*** 2872,2880 ****
        p = vim_strnsave(str, (int)len);
        if (p == NULL)
            return;
!       if (must_append)
        {
!           s = concat_str(get_expr_line_src(), p);
            vim_free(p);
            p = s;
        }
--- 2872,2880 ----
        p = vim_strnsave(str, (int)len);
        if (p == NULL)
            return;
!       if (must_append && expr_line != NULL)
        {
!           s = concat_str(expr_line, p);
            vim_free(p);
            p = s;
        }
*** ../vim-8.1.2405/src/version.c       2019-12-07 17:21:59.546665312 +0100
--- src/version.c       2019-12-07 17:40:12.694546899 +0100
***************
*** 744,745 ****
--- 744,747 ----
  {   /* Add new patch number below this line */
+ /**/
+     2406,
  /**/

-- 
Don't be humble ... you're not that great.
                      -- Golda Meir

 /// 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/201912071647.xB7Glohc014828%40masaka.moolenaar.net.

Raspunde prin e-mail lui