diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 37b7c04c0..89e2ee544 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; }