From 4b9d2caec21f2150e4b253d5201809d77a1e0912 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 21 Jun 2016 22:40:09 +0300 Subject: shada: Do not forget to close ShaDa reader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- src/nvim/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/file.c') 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; } -- cgit