mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 03:40:24 +00:00
netplay: allocate crashfix
Handle no devices
This commit is contained in:
parent
7d313647ae
commit
033be6ca0a
@ -158,7 +158,10 @@ netplay_input_state_t netplay_input_state_for(
|
||||
return NULL;
|
||||
|
||||
/* Couldn't find a slot, allocate a fresh one */
|
||||
ret = (netplay_input_state_t)calloc(1, sizeof(struct netplay_input_state) + (size-1) * sizeof(uint32_t));
|
||||
if (size > 1)
|
||||
ret = (netplay_input_state_t)calloc(1, sizeof(struct netplay_input_state) + (size-1) * sizeof(uint32_t));
|
||||
else
|
||||
ret = (netplay_input_state_t)calloc(1, sizeof(struct netplay_input_state));
|
||||
if (!ret)
|
||||
return NULL;
|
||||
*list = ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user