mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-09 18:45:35 +00:00
Fix memory leak when X11 toolkit window locale SDL_strdup() fails
This commit is contained in:
committed by
Sam Lantinga
parent
72d5fe213f
commit
fb1d1ab306
@@ -976,6 +976,7 @@ SDL_ToolkitWindowX11 *X11Toolkit_CreateWindowStruct(SDL_Window *parent, SDL_Tool
|
||||
if (window->origlocale) {
|
||||
window->origlocale = SDL_strdup(window->origlocale);
|
||||
if (!window->origlocale) {
|
||||
SDL_free(window);
|
||||
return NULL;
|
||||
}
|
||||
(void)setlocale(LC_ALL, "");
|
||||
|
||||
Reference in New Issue
Block a user