patch 7.4.1137
Problem:    Illegal memory access when using :copen and :cclose.
Solution:   Avoid that curbuf is invalid. (suggestion by Justin M. Keyes)
            Add a test.
diff --git a/src/window.c b/src/window.c
index 95515b5..408c4bd 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2445,6 +2445,10 @@
 	if (win_valid(win))
 	    win->w_closing = FALSE;
 #endif
+	/* Make sure curbuf is valid. It can become invalid if 'bufhidden' is
+	 * "wipe". */
+	if (!buf_valid(curbuf))
+	    curbuf = firstbuf;
     }
 
     if (only_one_window() && win_valid(win) && win->w_buffer == NULL