aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-11 15:53:59 -0400
committerJustin M. Keyes <justinkz@gmail.com>2019-05-11 21:53:59 +0200
commit7c9d4d971cab4525fb2245ec527736b4e9471e84 (patch)
tree26f49fb751e74c0e9ba36ccb2d6c8cdfce560760 /src
parentda3c0e4962899645c8cfa06ee21429b4410a63ca (diff)
downloadrneovim-7c9d4d971cab4525fb2245ec527736b4e9471e84.tar.gz
rneovim-7c9d4d971cab4525fb2245ec527736b4e9471e84.tar.bz2
rneovim-7c9d4d971cab4525fb2245ec527736b4e9471e84.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/nvim/move.c4
1 files changed, 2 insertions, 2 deletions
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) {