From 7c9d4d971cab4525fb2245ec527736b4e9471e84 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 11 May 2019 15:53:59 -0400 Subject: vim-patch:8.1.0543: fix memory leak #10001 Problem: Coverity warns for leaking memory and using wrong struct. Solution: Free pointer when allocation fails. Change "boff" to "loff". (closes vim/vim#3634) https://github.com/vim/vim/commit/4e303c8ba8dcd0566a1ad7c82ff18eb016eea335 --- src/nvim/move.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/move.c b/src/nvim/move.c index 43fdf0a4d1..e076543614 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -1524,9 +1524,9 @@ void scroll_cursor_bot(int min_scroll, int set_topbot) /* Count screen lines that are below the window. */ scrolled += loff.height; if (loff.lnum == curwin->w_botline - && boff.fill == 0 - ) + && loff.fill == 0) { scrolled -= curwin->w_empty_rows; + } } if (boff.lnum < curbuf->b_ml.ml_line_count) { -- cgit