]> granicus.if.org Git - vim/commitdiff
patch 8.1.0543: Coverity warns for leaking memory and using wrong struct v8.1.0543
authorBram Moolenaar <Bram@vim.org>
Sat, 24 Nov 2018 13:27:44 +0000 (14:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 24 Nov 2018 13:27:44 +0000 (14:27 +0100)
Problem:    Coverity warns for leaking memory and using wrong struct.
Solution:   Free pointer when allocation fails. Change "boff" to "loff".
            (closes #3634)

src/ex_getln.c
src/move.c
src/version.c

index 31e646dd353eaaccc700a4b6f9e932f0fecca7d0..acccd27321ae74a714d97bf6c1c95b7732244923 100644 (file)
@@ -1378,6 +1378,7 @@ getcmdline_int(
                            redrawcmd();
                            goto cmdline_changed;
                        }
+                       vim_free(p);
                    }
                }
                beep_flush();
index 214c362f4e51ecc5e383881ae4b688d866a78152..a94a1ab9d379ce603ca828b0ca4c3db153c15491 100644 (file)
@@ -1961,7 +1961,7 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
            scrolled += loff.height;
            if (loff.lnum == curwin->w_botline
 #ifdef FEAT_DIFF
-                           && boff.fill == 0
+                           && loff.fill == 0
 #endif
                    )
                scrolled -= curwin->w_empty_rows;
index 82b8abe5d5eb78915d1d489c222d3f97257014e7..2d7f2e624704bbccfd3be183783029115e961218 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    543,
 /**/
     542,
 /**/