]> granicus.if.org Git - vim/commitdiff
patch 8.2.0681: pattern for 'hlsearch' highlighting may leak v8.2.0681
authorBram Moolenaar <Bram@vim.org>
Sat, 2 May 2020 16:33:25 +0000 (18:33 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 May 2020 16:33:25 +0000 (18:33 +0200)
Problem:    Pattern for 'hlsearch' highlighting may leak. (Dominique Pelle)
Solution:   Call end_search_hl() to make sure the previous pattern is freed.
            (closes #6028)

src/screen.c
src/version.c

index 09aa10f0bc89e6c48ee25a98ad13cb04d0ccaf95..e218196fd7492e96b2f394cb3cfccb0fe71fe186 100644 (file)
@@ -1718,6 +1718,7 @@ start_search_hl(void)
 {
     if (p_hls && !no_hlsearch)
     {
+       end_search_hl();  // just in case it wasn't called before
        last_pat_prog(&screen_search_hl.rm);
        screen_search_hl.attr = HL_ATTR(HLF_L);
 # ifdef FEAT_RELTIME
index 02f7b6ef6d48ba5101250773f8a2e490cd525d87..982ac1f8873da319c014a09e5139c748caa02893 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    681,
 /**/
     680,
 /**/