mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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:
@@ -960,7 +960,10 @@ do_bang(
|
|||||||
// Don't do anything if there is no command as there isn't really anything
|
// Don't do anything if there is no command as there isn't really anything
|
||||||
// useful in running "sh -c ''". Avoids changing "prevcmd".
|
// useful in running "sh -c ''". Avoids changing "prevcmd".
|
||||||
if (STRLEN(newcmd) == 0)
|
if (STRLEN(newcmd) == 0)
|
||||||
|
{
|
||||||
|
vim_free(newcmd);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
vim_free(prevcmd);
|
vim_free(prevcmd);
|
||||||
prevcmd = newcmd;
|
prevcmd = newcmd;
|
||||||
|
@@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
785,
|
||||||
/**/
|
/**/
|
||||||
784,
|
784,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user