Fix issue detected by static analysis tool
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 3 Jan 2024 07:12:11 +0000 (16:12 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 3 Jan 2024 07:12:11 +0000 (16:12 +0900)
Change-Id: Iaebabbf2a7ee68693cf87c617ca698b8f54bf247
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
test/compose.c

index 8c633d7..4f3ae17 100644 (file)
@@ -715,7 +715,8 @@ main(int argc, char *argv[])
 #ifdef __linux__
     const char *srcdir = getenv("top_srcdir");
     clearenv();
-    setenv("top_srcdir", srcdir, 1);
+    if (srcdir)
+        setenv("top_srcdir", srcdir, 1);
 #else
     unsetenv("XCOMPOSEFILE");
     unsetenv("XDG_CONFIG_HOME");