From 69bbe4ce7dde521aca82db398fdc599016e8f030 Mon Sep 17 00:00:00 2001 From: zll Date: Thu, 29 Sep 2022 15:50:50 +0800 Subject: [PATCH] Fix memory leak in VITA_GXM_CreateRenderer --- src/render/vitagxm/SDL_render_vita_gxm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c index b76a91bd1..55ffe0cde 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; }