changeset 9095:634a8299bd2c v7.4.1832

commit https://github.com/vim/vim/commit/dc303bce10c60a3314078ea168064552fadf01af Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 17 17:45:38 2016 +0200 patch 7.4.1832 Problem: Memory leak in debug commands. Solution: Free memory before overwriting the pointer. (hint by Justin Keyes)
author Christian Brabandt <cb@256bit.org>
date Tue, 17 May 2016 18:00:05 +0200
parents adf5f3bcb6aa
children e6ecaa231a5d
files src/ex_cmds2.c src/version.c
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -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;
     }
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1832,
+/**/
     1831,
 /**/
     1830,