commit 5b77dde8dd281b1db1f503d9b270c3697f88bd65
parent c0f10d3fe018990b68cfa47bd84693449100f449
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue, 18 Apr 2023 14:22:16 +0800
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:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git 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;
}