mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-27 21:27:12 +00:00
(RGUI) Return null if calloc of rgui struct fails in rgui_init
This commit is contained in:
parent
34ed0b3e04
commit
04c84dc36c
@ -580,6 +580,9 @@ static void *rgui_init(void)
|
||||
|
||||
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui));
|
||||
|
||||
if (!rgui)
|
||||
return NULL;
|
||||
|
||||
rgui->frame_buf = framebuf;
|
||||
rgui->width = 320;
|
||||
rgui->height = 240;
|
||||
@ -604,6 +607,7 @@ static void *rgui_init(void)
|
||||
static void rgui_free(void *data)
|
||||
{
|
||||
rgui_handle_t *rgui = (rgui_handle_t*)data;
|
||||
|
||||
if (rgui->alloc_font)
|
||||
free((uint8_t*)rgui->font);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user