aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsid-6581 <sid6581@gmail.com>2023-09-17 18:07:08 -0500
committerGitHub <noreply@github.com>2023-09-18 07:07:08 +0800
commit57ccd8241735d4867692ed179a14f484909f3621 (patch)
tree5813db2eca82dcb13fe376ff4a079a2de3383dcd
parent9de5cb0b32f60bb0060335b1e0f4e4dd1c6cbf73 (diff)
downloadrneovim-57ccd8241735d4867692ed179a14f484909f3621.tar.gz
rneovim-57ccd8241735d4867692ed179a14f484909f3621.tar.bz2
rneovim-57ccd8241735d4867692ed179a14f484909f3621.zip
fix(job-control): fix use after free (#25223)
-rw-r--r--src/nvim/os/pty_process_win.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/os/pty_process_win.c b/src/nvim/os/pty_process_win.c
index abeb020645..763d30d4a2 100644
--- a/src/nvim/os/pty_process_win.c
+++ b/src/nvim/os/pty_process_win.c
@@ -256,9 +256,9 @@ static int build_cmd_line(char **argv, wchar_t **cmd_line, bool is_cmdexe)
QUEUE_FOREACH(q, &args_q, {
ArgNode *arg_node = QUEUE_DATA(q, ArgNode, node);
xstrlcat(utf8_cmd_line, arg_node->arg, utf8_cmd_line_len);
+ QUEUE_REMOVE(q);
xfree(arg_node->arg);
xfree(arg_node);
- QUEUE_REMOVE(q);
if (!QUEUE_EMPTY(&args_q)) {
xstrlcat(utf8_cmd_line, " ", utf8_cmd_line_len);
}