mirror of https://github.com/mpv-player/mpv
ipc: fix undefined behavior in some error cases
goto jumping over an initialization.
This commit is contained in:
parent
e4b963e643
commit
a56a7f3e8c
|
@ -244,6 +244,7 @@ static char *json_execute_command(struct client_arg *arg, void *ta_parent,
|
|||
|
||||
mpv_node msg_node;
|
||||
mpv_node reply_node = {.format = MPV_FORMAT_NODE_MAP, .u.list = NULL};
|
||||
mpv_node *reqid_node = NULL;
|
||||
|
||||
rc = json_parse(ta_parent, &msg_node, &src, 3);
|
||||
if (rc < 0) {
|
||||
|
@ -257,7 +258,7 @@ static char *json_execute_command(struct client_arg *arg, void *ta_parent,
|
|||
goto error;
|
||||
}
|
||||
|
||||
mpv_node *reqid_node = mpv_node_map_get(&msg_node, "request_id");
|
||||
reqid_node = mpv_node_map_get(&msg_node, "request_id");
|
||||
|
||||
mpv_node *cmd_node = mpv_node_map_get(&msg_node, "command");
|
||||
if (!cmd_node ||
|
||||
|
|
Loading…
Reference in New Issue