mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix: fix use after free
This commit is contained in:
@@ -256,9 +256,9 @@ static int build_cmd_line(char **argv, wchar_t **cmd_line, bool is_cmdexe)
|
|||||||
QUEUE_FOREACH(q, &args_q, {
|
QUEUE_FOREACH(q, &args_q, {
|
||||||
ArgNode *arg_node = QUEUE_DATA(q, ArgNode, node);
|
ArgNode *arg_node = QUEUE_DATA(q, ArgNode, node);
|
||||||
xstrlcat(utf8_cmd_line, arg_node->arg, utf8_cmd_line_len);
|
xstrlcat(utf8_cmd_line, arg_node->arg, utf8_cmd_line_len);
|
||||||
|
QUEUE_REMOVE(q);
|
||||||
xfree(arg_node->arg);
|
xfree(arg_node->arg);
|
||||||
xfree(arg_node);
|
xfree(arg_node);
|
||||||
QUEUE_REMOVE(q);
|
|
||||||
if (!QUEUE_EMPTY(&args_q)) {
|
if (!QUEUE_EMPTY(&args_q)) {
|
||||||
xstrlcat(utf8_cmd_line, " ", utf8_cmd_line_len);
|
xstrlcat(utf8_cmd_line, " ", utf8_cmd_line_len);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user