summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-10 15:16:54 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-10 15:16:54 +0100
commit622b64603748cceafd47f7537b96610e824e0680 (patch)
treee95de8c7584128a3e896ae832699e9d2cc83e48a
parentd6beab0248cdb0b7073e97d98d65de7138cb3386 (diff)
downloadvim-git-622b64603748cceafd47f7537b96610e824e0680.tar.gz
patch 8.1.2286: using border highlight in popup window leaks memoryv8.1.2286
Problem: Using border highlight in popup window leaks memory. Solution: Free memory before overwriting. (Dominique Pelle, closes #5203)
-rw-r--r--src/popupwin.c6
-rw-r--r--src/version.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index ac8fff3d6..41839b44a 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -755,12 +755,18 @@ apply_general_options(win_T *wp, dict_T *dict)
{
str = tv_get_string(&li->li_tv);
if (*str != NUL)
+ {
+ vim_free(wp->w_border_highlight[i]);
wp->w_border_highlight[i] = vim_strsave(str);
+ }
}
if (list->lv_len == 1 && wp->w_border_highlight[0] != NULL)
for (i = 1; i < 4; ++i)
+ {
+ vim_free(wp->w_border_highlight[i]);
wp->w_border_highlight[i] =
vim_strsave(wp->w_border_highlight[0]);
+ }
}
}
diff --git a/src/version.c b/src/version.c
index 823d4d8d6..ab75ea75f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2286,
+/**/
2285,
/**/
2284,