summaryrefslogtreecommitdiff
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-05-17 17:45:38 +0200
committerBram Moolenaar <Bram@vim.org>2016-05-17 17:45:38 +0200
commitdc303bce10c60a3314078ea168064552fadf01af (patch)
tree8adc8a5e2eb1c576518fccc2d6051ef0aef9fb6b /src/ex_cmds2.c
parente40d75f6ef73095286b66e546c70ff6f045e009d (diff)
downloadvim-git-dc303bce10c60a3314078ea168064552fadf01af.tar.gz
patch 7.4.1832v7.4.1832
Problem: Memory leak in debug commands. Solution: Free memory before overwriting the pointer. (hint by Justin Keyes)
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 4ddfbe421..256acec7c 100644
--- 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;
}