vim-patch:8.2.0681: pattern for 'hlsearch' highlighting may leak

Problem:    Pattern for 'hlsearch' highlighting may leak. (Dominique Pelle)
Solution:   Call end_search_hl() to make sure the previous pattern is freed.
            (closes vim/vim#6028)
0b6849e9e3
This commit is contained in:
Jan Edmund Lazo 2020-05-02 16:29:25 -04:00
parent bc29283f20
commit 5a0744e446
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -5714,6 +5714,7 @@ void grid_puts_line_flush(bool set_cursor)
static void start_search_hl(void) static void start_search_hl(void)
{ {
if (p_hls && !no_hlsearch) { if (p_hls && !no_hlsearch) {
end_search_hl(); // just in case it wasn't called before
last_pat_prog(&search_hl.rm); last_pat_prog(&search_hl.rm);
// Set the time limit to 'redrawtime'. // Set the time limit to 'redrawtime'.
search_hl.tm = profile_setlimit(p_rdt); search_hl.tm = profile_setlimit(p_rdt);