# HG changeset patch # User Bram Moolenaar # Date 1573396203 -3600 # Node ID 351659cbadb406481ca056403b90c31bf42d6991 # Parent cc918e1f4ed60cd33e927d4ed6cf9707448544bd patch 8.1.2286: using border highlight in popup window leaks memory Commit: https://github.com/vim/vim/commit/622b64603748cceafd47f7537b96610e824e0680 Author: Bram Moolenaar Date: Sun Nov 10 15:16:54 2019 +0100 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 https://github.com/vim/vim/issues/5203) diff --git a/src/popupwin.c b/src/popupwin.c --- a/src/popupwin.c +++ b/src/popupwin.c @@ -755,12 +755,18 @@ apply_general_options(win_T *wp, dict_T { 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 --- 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,