diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-07 19:26:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-07 19:26:19 +0200 |
commit | b5098060f4acae4dac3203130278c948d670a3d5 (patch) | |
tree | ec0d3f74f0870182621c8d0113093cba38a3462f | |
parent | 599a6e5b3629d943a795cd69e4d3d19886f86405 (diff) |
patch 8.2.3115: Coverity complains about free_wininfo() usev8.2.3115
Problem: Coverity complains about free_wininfo() use.
Solution: Add a condition that "wip2" is not equal to "wip". (Neovim #14996)
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/window.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/version.c b/src/version.c index 7dfbe6dd8f..e2f74e926c 100644 --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3115, +/**/ 3114, /**/ 3113, diff --git a/src/window.c b/src/window.c index 09067b081d..cc9c217b47 100644 --- a/src/window.c +++ b/src/window.c @@ -5057,8 +5057,9 @@ win_free( // If there already is an entry with "wi_win" set to NULL it // must be removed, it would never be used. + // Skip "wip" itself, otherwise Coverity complains. for (wip2 = buf->b_wininfo; wip2 != NULL; wip2 = wip2->wi_next) - if (wip2->wi_win == NULL) + if (wip2 != wip && wip2->wi_win == NULL) { if (wip2->wi_next != NULL) wip2->wi_next->wi_prev = wip2->wi_prev; |