diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-12 12:21:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-12 12:21:01 +0100 |
commit | 13c50e8aa569bf5fa01a7dc052cde8cdf1886c99 (patch) | |
tree | 85bac7eb1bfbc1ad867ce550b5e5b121644835ca /platform | |
parent | e40395669cf277e948e1a520a6584ce0deafd91a (diff) | |
parent | d308eb091a6c6d73442a118d7069e855ec2b1c6d (diff) |
Merge pull request #25481 from hpvb/fix-ubsan-asan-reports
Fix many asan and ubsan reported issues
Diffstat (limited to 'platform')
-rw-r--r-- | platform/x11/os_x11.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index e0924fc982..ca4b02bb49 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -3004,7 +3004,9 @@ bool OS_X11::is_vsync_enabled() const { */ void OS_X11::set_context(int p_context) { + char *config_name = NULL; XClassHint *classHint = XAllocClassHint(); + if (classHint) { char *wm_class = (char *)"Godot"; @@ -3015,13 +3017,15 @@ void OS_X11::set_context(int p_context) { if (p_context == CONTEXT_ENGINE) { classHint->res_name = (char *)"Godot_Engine"; - wm_class = (char *)((String)GLOBAL_GET("application/config/name")).utf8().ptrw(); + config_name = strdup((char *)((String)GLOBAL_GET("application/config/name")).utf8().ptrw()); + wm_class = config_name; } classHint->res_class = wm_class; XSetClassHint(x11_display, x11_window, classHint); XFree(classHint); + free(config_name); } } |