mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01: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) {
|
if (window->origlocale) {
|
||||||
window->origlocale = SDL_strdup(window->origlocale);
|
window->origlocale = SDL_strdup(window->origlocale);
|
||||||
if (!window->origlocale) {
|
if (!window->origlocale) {
|
||||||
|
SDL_free(window);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
(void)setlocale(LC_ALL, "");
|
(void)setlocale(LC_ALL, "");
|
||||||
|
|||||||
Reference in New Issue
Block a user