+ const char *env_val = lttng_ust_getenv("LTTNG_UST_APP_PATH");
+ char *val = NULL;
+ char *sep = NULL;
+ if (env_val == NULL)
+ goto error;
+ sep = strchr((char*)env_val, ':');
+ if (sep) {
+ /*
+ * Split into multiple paths using ':' as a separator.
+ * There is no escaping of the ':' separator.
+ */
+ WARN("':' separator in LTTNG_UST_APP_PATH, only the first path will be used.");
+ val = zmalloc(sep - env_val + 1);
+ if (!val) {
+ PERROR("zmalloc get_lttng_ust_app_path");
+ goto error;
+ }
+ memcpy(val, env_val, sep - env_val);
+ val[sep - env_val] = '\0';
+ } else {
+ val = strdup(env_val);
+ if (!val) {
+ PERROR("strdup");
+ goto error;
+ }
+ }
+
+error:
+ return val;