mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.1.2286: using border highlight in popup window leaks memory
Problem: Using border highlight in popup window leaks memory. Solution: Free memory before overwriting. (Dominique Pelle, closes #5203)
This commit is contained in:
@@ -755,12 +755,18 @@ apply_general_options(win_T *wp, dict_T *dict)
|
|||||||
{
|
{
|
||||||
str = tv_get_string(&li->li_tv);
|
str = tv_get_string(&li->li_tv);
|
||||||
if (*str != NUL)
|
if (*str != NUL)
|
||||||
|
{
|
||||||
|
vim_free(wp->w_border_highlight[i]);
|
||||||
wp->w_border_highlight[i] = vim_strsave(str);
|
wp->w_border_highlight[i] = vim_strsave(str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (list->lv_len == 1 && wp->w_border_highlight[0] != NULL)
|
if (list->lv_len == 1 && wp->w_border_highlight[0] != NULL)
|
||||||
for (i = 1; i < 4; ++i)
|
for (i = 1; i < 4; ++i)
|
||||||
|
{
|
||||||
|
vim_free(wp->w_border_highlight[i]);
|
||||||
wp->w_border_highlight[i] =
|
wp->w_border_highlight[i] =
|
||||||
vim_strsave(wp->w_border_highlight[0]);
|
vim_strsave(wp->w_border_highlight[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -741,6 +741,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 */
|
||||||
|
/**/
|
||||||
|
2286,
|
||||||
/**/
|
/**/
|
||||||
2285,
|
2285,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user