diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-18 14:22:16 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-18 14:22:59 +0800 |
commit | 5b77dde8dd281b1db1f503d9b270c3697f88bd65 (patch) | |
tree | ae2bbaa82f662d9b36665dd7facdb1ebea9c6410 /src | |
parent | c0f10d3fe018990b68cfa47bd84693449100f449 (diff) | |
download | rneovim-5b77dde8dd281b1db1f503d9b270c3697f88bd65.tar.gz rneovim-5b77dde8dd281b1db1f503d9b270c3697f88bd65.tar.bz2 rneovim-5b77dde8dd281b1db1f503d9b270c3697f88bd65.zip |
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.
https://github.com/vim/vim/commit/9652249a2d02318a28a63a7b5711f25652e8f969
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index cc8c4aeca8..015f651872 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -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 // useful in running "sh -c ''". Avoids changing "prevcmd". if (strlen(newcmd) == 0) { + xfree(newcmd); return; } |