Commit 0983fcee5ef6b7a56d308b4098379f3d2e591adb

pionere 2022-02-05T12:28:37

fix memory leak in D3D11_CreateRenderer

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c
index 37b7c04..89e2ee5 100644
--- a/src/render/direct3d11/SDL_render_d3d11.c
+++ b/src/render/direct3d11/SDL_render_d3d11.c
@@ -2345,6 +2345,7 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags)
 
     data = (D3D11_RenderData *) SDL_calloc(1, sizeof(*data));
     if (!data) {
+        SDL_free(renderer);
         SDL_OutOfMemory();
         return NULL;
     }