aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-09-05 10:16:56 +0300
committerJustin M. Keyes <justinkz@gmail.com>2016-09-04 21:45:48 -0400
commit6127eaef0534d1ff5b96b8ed15854b4bedf8e9b4 (patch)
treed0fde734dac4ec478db6aa0e04b682aa16d89634 /src
parentcd321b7d0fb161b77cd7b25da7f9a4721cfb0110 (diff)
downloadrneovim-6127eaef0534d1ff5b96b8ed15854b4bedf8e9b4.tar.gz
rneovim-6127eaef0534d1ff5b96b8ed15854b4bedf8e9b4.tar.bz2
rneovim-6127eaef0534d1ff5b96b8ed15854b4bedf8e9b4.zip
shada: Fix non-writeable ShaDa directory handling
Before this change, nvim -i /etc/shada segfaults on exit if the file does not exist and user does not have permissions to create the file at /etc/shada. Closes #5296 Reported in #5277 https://github.com/neovim/neovim/issues/5277#issuecomment-243937255
Diffstat (limited to 'src')
-rw-r--r--src/nvim/shada.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/shada.c b/src/nvim/shada.c
index fe62f06e59..d2d0d503b9 100644
--- a/src/nvim/shada.c
+++ b/src/nvim/shada.c
@@ -2976,7 +2976,7 @@ shada_write_file_nomerge: {}
if (sd_writer.cookie == NULL) {
xfree(fname);
xfree(tempname);
- if (sd_reader.close != NULL) {
+ if (sd_reader.cookie != NULL) {
sd_reader.close(&sd_reader);
}
return FAIL;