diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-02-05 15:10:51 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-02-05 15:10:51 +0100 |
commit | 955f198fc546cc30a34361932d3f454a61df0efa (patch) | |
tree | 04a9cf18bd3af2e373747341d91e6bcc86332690 /src/window.c | |
parent | e971df39a5aac5d9b7e8033247dc18b12daa0eb8 (diff) | |
download | vim-git-955f198fc546cc30a34361932d3f454a61df0efa.tar.gz |
patch 8.0.0307: asan detects a memory error when EXITFREE is definedv8.0.0307
Problem: Asan detects a memory error when EXITFREE is defined. (Dominique
Pelle)
Solution: In getvcol() check for ml_get_buf() returning an empty string.
Also skip adjusting the scroll position. Set "exiting" in
mch_exit() for all systems.
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c index ee5f7aa8a..6b7bd353a 100644 --- a/src/window.c +++ b/src/window.c @@ -5708,7 +5708,10 @@ win_new_height(win_T *wp, int height) wp->w_height = height; wp->w_skipcol = 0; - scroll_to_fraction(wp, prev_height); + /* There is no point in adjusting the scroll position when exiting. Some + * values might be invalid. */ + if (!exiting) + scroll_to_fraction(wp, prev_height); } void |