Merge pull request #1568 from lioncash/retval

hid: Fix return of potentially uninitialized pointers
This commit is contained in:
Twinaphex 2015-04-02 15:45:22 +02:00
commit d9b96374f0
2 changed files with 2 additions and 12 deletions

View File

@ -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)

View File

@ -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)