mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 08:56:29 +00:00
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.
9652249a2d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1015,6 +1015,7 @@ void do_bang(int addr_count, exarg_T *eap, bool forceit, bool do_in, bool do_out
|
|||||||
// 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) {
|
||||||
|
xfree(newcmd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user