patch 8.0.0083
Problem:    Using freed memory with win_getid(). (Domenique Pelle)
Solution:   For the current tab use curwin.
diff --git a/src/window.c b/src/window.c
index 8e53368..ee5f7aa 100644
--- a/src/window.c
+++ b/src/window.c
@@ -7133,7 +7133,10 @@
 		    break;
 	    if (tp == NULL)
 		return -1;
-	    wp = tp->tp_firstwin;
+	    if (tp == curtab)
+		wp = firstwin;
+	    else
+		wp = tp->tp_firstwin;
 	}
 	for ( ; wp != NULL; wp = wp->w_next)
 	    if (--winnr == 0)