# HG changeset patch # User Bram Moolenaar # Date 1267547001 -3600 # Node ID c1f67ce5740adaa7e1e164d706f204252711d5df # Parent 3259c3923c1ef2ec1783c828828c7f4e728c3f4b updated for version 7.2.382 Problem: Accessing freed memory when closing the cmdline window when 'bufhide' is set to "wipe". Solution: Check if the buffer still exists before invoking close_buffer() (Dominique Pelle) diff --git a/src/ex_getln.c b/src/ex_getln.c --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -6252,7 +6252,11 @@ ex_window() bp = curbuf; win_goto(old_curwin); win_close(wp, TRUE); - close_buffer(NULL, bp, DOBUF_WIPE); + + /* win_close() may have already wiped the buffer when 'bh' is + * set to 'wipe' */ + if (buf_valid(bp)) + close_buffer(NULL, bp, DOBUF_WIPE); /* Restore window sizes. */ win_size_restore(&winsizes); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -682,6 +682,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 382, +/**/ 381, /**/ 380,