summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-11-30 15:40:56 +0100
committerBram Moolenaar <Bram@vim.org>2011-11-30 15:40:56 +0100
commit89c7122c05c69222a22fe78f570264c6f91851b8 (patch)
tree4bd798d9d9c0fb733f1ef5f10202ad85a94c0f3c /src/buffer.c
parent8000baffa7bc80773d4a80769837e73e5c5715b5 (diff)
downloadvim-git-89c7122c05c69222a22fe78f570264c6f91851b8.tar.gz
updated for version 7.3.361v7.3.361
Problem: Accessing memory after it is freed when EXITFREE is defined. Solution: Don't access curwin when firstwin is NULL. (Dominique Pelle)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c
index d4a9c1eeb..5b2ec6871 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -567,8 +567,9 @@ buf_freeall(buf, flags)
diff_buf_delete(buf); /* Can't use 'diff' for unloaded buffer. */
#endif
#ifdef FEAT_SYN_HL
- if (curwin->w_buffer == buf)
- reset_synblock(curwin); /* remove any ownsyntax */
+ /* Remove any ownsyntax, unless exiting. */
+ if (firstwin != NULL && curwin->w_buffer == buf)
+ reset_synblock(curwin);
#endif
#ifdef FEAT_FOLDING