Patch 8.1.2406

8 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 7, 2019, 11:47:56 AM12/7/19
to vim...@googlegroups.com

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 -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages