summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlikeich <57882701+likeich@users.noreply.github.com>2021-07-08 22:34:07 -0400
committerlikeich <57882701+likeich@users.noreply.github.com>2021-07-08 22:34:07 -0400
commit0314e049399227935afaa30feaefc5c3a0a0dde6 (patch)
tree57bba2720125a424c5235c66875eb654f56c572c
parent14cc1df1d8921600758bb40d27dde1200f109414 (diff)
Fix linux use after free
Fixes #50032
-rw-r--r--platform/linuxbsd/freedesktop_screensaver.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/linuxbsd/freedesktop_screensaver.cpp b/platform/linuxbsd/freedesktop_screensaver.cpp
index 23093698ba..a6a3b27d76 100644
--- a/platform/linuxbsd/freedesktop_screensaver.cpp
+++ b/platform/linuxbsd/freedesktop_screensaver.cpp
@@ -55,7 +55,8 @@ void FreeDesktopScreenSaver::inhibit() {
}
String app_name_string = ProjectSettings::get_singleton()->get("application/config/name");
- const char *app_name = app_name_string.is_empty() ? "Godot Engine" : app_name_string.utf8().get_data();
+ CharString app_name_utf8 = app_name_string.utf8();
+ const char *app_name = app_name_string.is_empty() ? "Godot Engine" : app_name_utf8.get_data();
const char *reason = "Running Godot Engine project";