changeset 30902:bea05c84b2ad v9.0.0785

patch 9.0.0785: memory leak with empty shell command Commit: https://github.com/vim/vim/commit/9652249a2d02318a28a63a7b5711f25652e8f969 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Oct 17 20:00:26 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Mon, 17 Oct 2022 21:15:03 +0200
parents a3cfcfad21d6
children 82279571d16f
files src/ex_cmds.c src/version.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    785,
+/**/
     784,
 /**/
     783,