mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -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
|
||||
// useful in running "sh -c ''". Avoids changing "prevcmd".
|
||||
if (STRLEN(newcmd) == 0)
|
||||
{
|
||||
vim_free(newcmd);
|
||||
return;
|
||||
}
|
||||
|
||||
vim_free(prevcmd);
|
||||
prevcmd = newcmd;
|
||||
|
Reference in New Issue
Block a user