Blame SOURCES/0001-patch-8.2.3115-Coverity-complains-about-free_wininfo.patch

20b5ab
From b5098060f4acae4dac3203130278c948d670a3d5 Mon Sep 17 00:00:00 2001
20b5ab
From: Bram Moolenaar <Bram@vim.org>
20b5ab
Date: Wed, 7 Jul 2021 19:26:19 +0200
20b5ab
Subject: [PATCH] patch 8.2.3115: Coverity complains about free_wininfo() use
20b5ab
20b5ab
Problem:    Coverity complains about free_wininfo() use.
20b5ab
Solution:   Add a condition that "wip2" is not equal to "wip". (Neovim #14996)
20b5ab
---
20b5ab
 src/version.c | 2 ++
20b5ab
 src/window.c  | 3 ++-
20b5ab
 2 files changed, 4 insertions(+), 1 deletion(-)
20b5ab
20b5ab
diff --git a/src/window.c b/src/window.c
20b5ab
index 09067b081..cc9c217b4 100644
20b5ab
--- a/src/window.c
20b5ab
+++ b/src/window.c
20b5ab
@@ -5057,8 +5057,9 @@ win_free(
20b5ab
 
20b5ab
 		// If there already is an entry with "wi_win" set to NULL it
20b5ab
 		// must be removed, it would never be used.
20b5ab
+		// Skip "wip" itself, otherwise Coverity complains.
20b5ab
 		for (wip2 = buf->b_wininfo; wip2 != NULL; wip2 = wip2->wi_next)
20b5ab
-		    if (wip2->wi_win == NULL)
20b5ab
+		    if (wip2 != wip && wip2->wi_win == NULL)
20b5ab
 		    {
20b5ab
 			if (wip2->wi_next != NULL)
20b5ab
 			    wip2->wi_next->wi_prev = wip2->wi_prev;
20b5ab
-- 
20b5ab
2.31.1
20b5ab