- /* Generate session name based on the session count */
- if (asprintf(&new_session->name, "%s%d", "lttng-", session_count) < 0) {
- goto error_mem;
+ ERR("No session name given");
+ ret = -1;
+ goto error;
+ }
+
+ /* Define session system path */
+ if (path != NULL) {
+ if (asprintf(&new_session->path, "%s", path) < 0) {
+ ret = -ENOMEM;
+ goto error_asprintf;