]> granicus.if.org Git - vim/commitdiff
patch 7.4.1832 v7.4.1832
authorBram Moolenaar <Bram@vim.org>
Tue, 17 May 2016 15:45:38 +0000 (17:45 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 17 May 2016 15:45:38 +0000 (17:45 +0200)
Problem:    Memory leak in debug commands.
Solution:   Free memory before overwriting the pointer. (hint by Justin Keyes)

src/ex_cmds2.c
src/version.c

index 4ddfbe421d862790e3556b4e15bfb7d10a5094c6..256acec7c487ae0d2db1c477d2d6592a10b65058 100644 (file)
@@ -164,6 +164,7 @@ do_debug(char_u *cmd)
            ignore_script = TRUE;
        }
 
+       vim_free(cmdline);
        cmdline = getcmdline_prompt('>', NULL, 0, EXPAND_NOTHING, NULL);
 
        if (typeahead_saved)
@@ -306,8 +307,6 @@ do_debug(char_u *cmd)
            (void)do_cmdline(cmdline, getexline, NULL,
                                                DOCMD_VERBOSE|DOCMD_EXCRESET);
            debug_break_level = n;
-
-           vim_free(cmdline);
        }
        lines_left = Rows - 1;
     }
index e1297c819a805de86fe2d541a8802d72f062853a..863a58f199086d253010a5fbf136aa2b9f216c51 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1832,
 /**/
     1831,
 /**/