diff options
author | wm4 <wm4@nowhere> | 2015-07-06 00:08:29 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-07-06 00:08:29 +0200 |
commit | a56a7f3e8c7dbed38546f3ddedb0e26353f92e25 (patch) | |
tree | ae044f6066b40b11642f750c8108f65cb6ea248e /input/ipc.c | |
parent | e4b963e643b93474d21e16b50c1e9fcf40bddcae (diff) | |
download | mpv-a56a7f3e8c7dbed38546f3ddedb0e26353f92e25.tar.bz2 mpv-a56a7f3e8c7dbed38546f3ddedb0e26353f92e25.tar.xz |
ipc: fix undefined behavior in some error cases
goto jumping over an initialization.
Diffstat (limited to 'input/ipc.c')
-rw-r--r-- | input/ipc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/input/ipc.c b/input/ipc.c index ec219da31f..5ed057edb6 100644 --- a/input/ipc.c +++ b/input/ipc.c @@ -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 || |