mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
Merge pull request #1568 from lioncash/retval
hid: Fix return of potentially uninitialized pointers
This commit is contained in:
commit
d9b96374f0
@ -442,7 +442,7 @@ static void *apple_hid_init(void)
|
||||
error:
|
||||
if (hid_apple)
|
||||
free(hid_apple);
|
||||
return hid_apple;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void apple_hid_free(void *data)
|
||||
|
@ -75,17 +75,7 @@ static int16_t null_hid_joypad_axis(void *data, unsigned port, uint32_t joyaxis)
|
||||
|
||||
static void *null_hid_init(void)
|
||||
{
|
||||
null_hid_t *hid_null = (null_hid_t*)calloc(1, sizeof(*hid_null));
|
||||
|
||||
if (!hid_null)
|
||||
goto error;
|
||||
|
||||
return hid_null;
|
||||
|
||||
error:
|
||||
if (hid_null)
|
||||
free(hid_null);
|
||||
return hid_null;
|
||||
return (null_hid_t*)calloc(1, sizeof(null_hid_t));
|
||||
}
|
||||
|
||||
static void null_hid_free(void *data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user