summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index f5271ea426..93f9dd700c 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -960,7 +960,10 @@ do_bang(
// Don't do anything if there is no command as there isn't really anything
// useful in running "sh -c ''". Avoids changing "prevcmd".
if (STRLEN(newcmd) == 0)
+ {
+ vim_free(newcmd);
return;
+ }
vim_free(prevcmd);
prevcmd = newcmd;