mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Fix invalid read from poor setlocale usage.
This commit is contained in:
parent
aae28e3ec1
commit
d9e3972acb
@ -399,6 +399,10 @@ X11_VideoInit(_THIS)
|
|||||||
const char *env_xmods = SDL_getenv("XMODIFIERS");
|
const char *env_xmods = SDL_getenv("XMODIFIERS");
|
||||||
SDL_bool has_dbus_ime_support = SDL_FALSE;
|
SDL_bool has_dbus_ime_support = SDL_FALSE;
|
||||||
|
|
||||||
|
if (prev_locale) {
|
||||||
|
prev_locale = SDL_strdup(prev_locale);
|
||||||
|
}
|
||||||
|
|
||||||
if (prev_xmods) {
|
if (prev_xmods) {
|
||||||
prev_xmods = SDL_strdup(prev_xmods);
|
prev_xmods = SDL_strdup(prev_xmods);
|
||||||
}
|
}
|
||||||
@ -431,6 +435,10 @@ X11_VideoInit(_THIS)
|
|||||||
setlocale(LC_ALL, prev_locale);
|
setlocale(LC_ALL, prev_locale);
|
||||||
X11_XSetLocaleModifiers(prev_xmods);
|
X11_XSetLocaleModifiers(prev_xmods);
|
||||||
|
|
||||||
|
if (prev_locale) {
|
||||||
|
SDL_free(prev_locale);
|
||||||
|
}
|
||||||
|
|
||||||
if (prev_xmods) {
|
if (prev_xmods) {
|
||||||
SDL_free(prev_xmods);
|
SDL_free(prev_xmods);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user