1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar 2022-10-17 20:00:26 +01:00
parent b99e6e6c5f
commit 9652249a2d
2 changed files with 5 additions and 0 deletions

View File

@ -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;

View File

@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
785,
/**/
784,
/**/