aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/file.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-06-21 22:40:09 +0300
committerZyX <kp-pav@yandex.ru>2016-06-23 21:17:51 +0300
commit4b9d2caec21f2150e4b253d5201809d77a1e0912 (patch)
tree4b76273849dbebb1058e530423ebca6cee17873e /src/nvim/file.c
parenta8f3849bc04cee5d7166138a28cb1e7bbf300803 (diff)
downloadrneovim-4b9d2caec21f2150e4b253d5201809d77a1e0912.tar.gz
rneovim-4b9d2caec21f2150e4b253d5201809d77a1e0912.tar.bz2
rneovim-4b9d2caec21f2150e4b253d5201809d77a1e0912.zip
shada: Do not forget to close ShaDa reader
Previously there was file descriptor leak, not detected by sanitizers. Now it is file descriptor leak with a small memory leak which is detected by ASAN what fails one of the tests (actually, “ShaDa support code leaves .tmp.z in-place when there is error in original ShaDa and it has .tmp.a … .tmp.x”, but error is reported at the next test because leaks are not detected until Neovim exit and Neovim exit happens when clear()/reset() is called which happens in before_each only).
Diffstat (limited to 'src/nvim/file.c')
-rw-r--r--src/nvim/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/file.c b/src/nvim/file.c
index 35c659f7fd..2fb0e1cd87 100644
--- a/src/nvim/file.c
+++ b/src/nvim/file.c
@@ -310,7 +310,7 @@ ptrdiff_t file_skip(FileDescriptor *const fp, const size_t size)
break;
}
read_bytes += (size_t)new_read_bytes;
- } while (read_bytes < size && !fp->eof);
+ } while (read_bytes < size && !file_eof(fp));
return (ptrdiff_t)read_bytes;
}