mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-12 04:31:19 +00:00
Attempt to fix Coverity ID 158346
This commit is contained in:
parent
ec3a4e219b
commit
7e43d9c469
@ -361,6 +361,9 @@ bool input_autoconfigure_disconnect(unsigned i, const char *ident)
|
|||||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||||
autoconfig_disconnect_t *state = (autoconfig_disconnect_t*)calloc(1, sizeof(*state));
|
autoconfig_disconnect_t *state = (autoconfig_disconnect_t*)calloc(1, sizeof(*state));
|
||||||
|
|
||||||
|
if (!state || !task)
|
||||||
|
goto error;
|
||||||
|
|
||||||
msg[0] = '\0';
|
msg[0] = '\0';
|
||||||
|
|
||||||
state->idx = i;
|
state->idx = i;
|
||||||
@ -369,9 +372,6 @@ bool input_autoconfigure_disconnect(unsigned i, const char *ident)
|
|||||||
msg_hash_to_str(MSG_DEVICE_DISCONNECTED_FROM_PORT),
|
msg_hash_to_str(MSG_DEVICE_DISCONNECTED_FROM_PORT),
|
||||||
i, ident);
|
i, ident);
|
||||||
|
|
||||||
if (!task || !state)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
strlcpy(state->msg, msg, sizeof(state->msg));
|
strlcpy(state->msg, msg, sizeof(state->msg));
|
||||||
|
|
||||||
task->state = state;
|
task->state = state;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user