Fix memory leak in VITA_GXM_CreateRenderer

This commit is contained in:
zll 2022-09-29 15:50:50 +08:00 committed by Ozkan Sezer
parent e17f0c283c
commit 69bbe4ce7d
1 changed files with 2 additions and 2 deletions

View File

@ -269,8 +269,6 @@ VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags)
renderer->driverdata = data; renderer->driverdata = data;
renderer->window = window; renderer->window = window;
if (data->initialized != SDL_FALSE)
return 0;
data->initialized = SDL_TRUE; data->initialized = SDL_TRUE;
if (flags & SDL_RENDERER_PRESENTVSYNC) { if (flags & SDL_RENDERER_PRESENTVSYNC) {
@ -286,6 +284,8 @@ VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags)
if (gxm_init(renderer) != 0) if (gxm_init(renderer) != 0)
{ {
SDL_free(data);
SDL_free(renderer);
return NULL; return NULL;
} }