To: vim_dev@googlegroups.com Subject: Patch 8.1.2286 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2286 Problem: Using border highlight in popup window leaks memory. Solution: Free memory before overwriting. (Dominique Pelle, closes #5203) Files: src/popupwin.c *** ../vim-8.1.2285/src/popupwin.c 2019-11-09 15:32:51.597873973 +0100 --- src/popupwin.c 2019-11-10 15:16:19.530342853 +0100 *************** *** 755,766 **** --- 755,772 ---- { 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]); + } } } *** ../vim-8.1.2285/src/version.c 2019-11-10 15:07:16.734954737 +0100 --- src/version.c 2019-11-10 15:15:26.214169349 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 2286, /**/ -- Be thankful to be in a traffic jam, because it means you own a car. /// Bram Moolenaar -- Bram@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 ///