summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2023-02-08 17:11:33 +0200
committerMavridis Philippe <mavridisf@gmail.com>2023-02-08 17:11:33 +0200
commit959798f451278a87d4b7e61e21475ab7a53032cd (patch)
tree8060cb2878742b33f689846190d076856c2c4bc9
parent6eeb944213399d885638a4ea1f54fe61bf82394f (diff)
downloadgtk-qt-engine-959798f451278a87d4b7e61e21475ab7a53032cd.tar.gz
gtk-qt-engine-959798f451278a87d4b7e61e21475ab7a53032cd.zip
Check for null pointerr14.1.0
This fixes a crash when the SESSION_MANAGER enviroment variable is not set. Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
-rw-r--r--src/qt_qt_wrapper.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qt_qt_wrapper.cpp b/src/qt_qt_wrapper.cpp
index 3767c08..b06161a 100644
--- a/src/qt_qt_wrapper.cpp
+++ b/src/qt_qt_wrapper.cpp
@@ -413,7 +413,9 @@ void createTQApp()
initKdeSettings();
#ifndef USE_SOLARIS
- setenv("SESSION_MANAGER", sessionEnv, 1);
+ if (sessionEnv) {
+ setenv("SESSION_MANAGER", sessionEnv, 1);
+ }
#else
char *tempEnv=(char *)malloc(strlen(sessionEnv)+strlen("SESSION_MANAGER")+2);
sprintf(tempEnv, "SESSION_MANAGER=%s", sessionEnv);