Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
int ret;
char *session_name, *trace_path = NULL;
struct lttng_session *sessions = NULL;
+ bool free_trace_path = false;
/*
* Safety net. If lttng is suid at some point for *any* useless reasons,
ret = CMD_ERROR;
goto free_sessions;
}
+ free_trace_path = true;
} else {
/* Get file system session path. */
trace_path = sessions[i].path;
}
free_sessions:
- if (session_live_mode) {
+ if (session_live_mode && free_trace_path) {
free(trace_path);
}
free(sessions);