e_comp: use e_util_env_get instead of getenv to get NULL-terminated string from the...
authorGwanglim Lee <gl77.lee@samsung.com>
Tue, 5 Dec 2017 11:50:00 +0000 (20:50 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 6 Dec 2017 02:09:08 +0000 (11:09 +0900)
Change-Id: I0a9c63c182e07e282700a660c7c04f89b75a011c

src/bin/e_comp.c

index 7f9a8da487055277290502ab23621ebf6c1f8518..51f03f74cf69b61fd99ccf10dd0a1b0c462e939c 100644 (file)
@@ -1121,11 +1121,13 @@ e_comp_socket_init(const char *name)
 #define STRERR_BUFSIZE 128
    char buf[STRERR_BUFSIZE];
 
-   dir = getenv("XDG_RUNTIME_DIR");
-   if (!dir) return EINA_FALSE;
    if (!name) return EINA_FALSE;
 
+   dir = e_util_env_get("XDG_RUNTIME_DIR");
+   if (!dir) return EINA_FALSE;
+
    snprintf(socket_path, sizeof(socket_path), "%s/%s", dir, name);
+   free(dir);
 
    EINA_LIST_FOREACH(e_config->sock_accesses, l, sa)
      {