patch 9.0.0785: memory leak with empty shell command
Problem: Memory leak with empty shell command.
Solution: Free the allocated memory when bailing out.
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index f5271ea..93f9dd7 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -960,7 +960,10 @@
// 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;
diff --git a/src/version.c b/src/version.c
index b912819..f3a7e29 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 785,
+/**/
784,
/**/
783,