forked from aniani/vim
patch 8.1.2406: leaking memory in test_paste and test_registers
Problem: Leaking memory in test_paste and test_registers. Solution: Free the old title. Don't copy expr_line.
This commit is contained in:
parent
1f9a028def
commit
6b649ac4fd
@ -1963,6 +1963,10 @@ get_x11_thing(
|
|||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
if (!test_only)
|
if (!test_only)
|
||||||
{
|
{
|
||||||
|
if (get_title)
|
||||||
|
vim_free(oldtitle);
|
||||||
|
else
|
||||||
|
vim_free(oldicon);
|
||||||
if (text_prop.encoding == XA_STRING && !has_mbyte)
|
if (text_prop.encoding == XA_STRING && !has_mbyte)
|
||||||
{
|
{
|
||||||
if (get_title)
|
if (get_title)
|
||||||
|
@ -2872,9 +2872,9 @@ write_reg_contents_ex(
|
|||||||
p = vim_strnsave(str, (int)len);
|
p = vim_strnsave(str, (int)len);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return;
|
return;
|
||||||
if (must_append)
|
if (must_append && expr_line != NULL)
|
||||||
{
|
{
|
||||||
s = concat_str(get_expr_line_src(), p);
|
s = concat_str(expr_line, p);
|
||||||
vim_free(p);
|
vim_free(p);
|
||||||
p = s;
|
p = s;
|
||||||
}
|
}
|
||||||
|
@ -2106,6 +2106,8 @@ tgetent_error(char_u *tbuf, char_u *term)
|
|||||||
{
|
{
|
||||||
int i;
|
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);
|
i = TGETENT(tbuf, term);
|
||||||
if (i < 0 // -1 is always an error
|
if (i < 0 // -1 is always an error
|
||||||
# ifdef TGETENT_ZERO_ERR
|
# ifdef TGETENT_ZERO_ERR
|
||||||
|
@ -742,6 +742,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2406,
|
||||||
/**/
|
/**/
|
||||||
2405,
|
2405,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user