Attempt to fix Coverity ID 158346

This commit is contained in:
twinaphex 2016-12-21 01:45:19 +01:00
parent ec3a4e219b
commit 7e43d9c469

View File

@ -361,6 +361,9 @@ bool input_autoconfigure_disconnect(unsigned i, const char *ident)
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
autoconfig_disconnect_t *state = (autoconfig_disconnect_t*)calloc(1, sizeof(*state));
if (!state || !task)
goto error;
msg[0] = '\0';
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),
i, ident);
if (!task || !state)
goto error;
strlcpy(state->msg, msg, sizeof(state->msg));
task->state = state;