patch 8.1.0543: Coverity warns for leaking memory and using wrong struct
Problem: Coverity warns for leaking memory and using wrong struct.
Solution: Free pointer when allocation fails. Change "boff" to "loff".
(closes #3634)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 31e646d..acccd27 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -1378,6 +1378,7 @@
redrawcmd();
goto cmdline_changed;
}
+ vim_free(p);
}
}
beep_flush();
diff --git a/src/move.c b/src/move.c
index 214c362..a94a1ab 100644
--- a/src/move.c
+++ b/src/move.c
@@ -1961,7 +1961,7 @@
scrolled += loff.height;
if (loff.lnum == curwin->w_botline
#ifdef FEAT_DIFF
- && boff.fill == 0
+ && loff.fill == 0
#endif
)
scrolled -= curwin->w_empty_rows;
diff --git a/src/version.c b/src/version.c
index 82b8abe..2d7f2e6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -793,6 +793,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 543,
+/**/
542,
/**/
541,