]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0118: memory leak in w_hl when reusing a popup window v9.2.0118
authorChristian Brabandt <cb@256bit.org>
Sat, 7 Mar 2026 17:44:24 +0000 (17:44 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 7 Mar 2026 17:44:24 +0000 (17:44 +0000)
Problem:  When a popup info window is reused, win_init_empty() resets
          w_hl to NULL without freeing the previously allocated value,
          causing a memory leak (after v9.2.0113)
Solution: Free w_hl before resetting it to NULL in win_init_empty()
          using the VIM_CLEAR() macro.

closes: #19607

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/version.c
src/window.c

index 7524fcd9659a83b341e481b58f08386b05031d8c..40fbefb3c98ed7a246c0f473cea2d62fbd5098cb 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    118,
 /**/
     117,
 /**/
index c078ed9aceb518474ce1d008c6c6e4c8823b9765..525fc4b2eb03af8e5ac606b37b961f9da50ab20a 100644 (file)
@@ -2522,7 +2522,7 @@ win_init_empty(win_T *wp)
     wp->w_prev_pcmark.lnum = 0;
     wp->w_prev_pcmark.col = 0;
     wp->w_topline = 1;
-    wp->w_hl = NULL;
+    VIM_CLEAR(wp->w_hl);
 #ifdef FEAT_DIFF
     wp->w_topfill = 0;
 #endif