Commit 69bbe4ce7dde521aca82db398fdc599016e8f030

zll 2022-09-29T15:50:50

Fix memory leak in VITA_GXM_CreateRenderer

diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c
index b76a91b..55ffe0c 100644
--- a/src/render/vitagxm/SDL_render_vita_gxm.c
+++ b/src/render/vitagxm/SDL_render_vita_gxm.c
@@ -269,8 +269,6 @@ VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags)
     renderer->driverdata = data;
     renderer->window = window;
 
-    if (data->initialized != SDL_FALSE)
-        return 0;
     data->initialized = SDL_TRUE;
 
     if (flags & SDL_RENDERER_PRESENTVSYNC) {
@@ -286,6 +284,8 @@ VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags)
 
     if (gxm_init(renderer) != 0)
     {
+        SDL_free(data);
+        SDL_free(renderer);
         return NULL;
     }