A relay_session object can be leaked if the relay daemon fails
to reply to the RELAYD_CREATE_SESSION command.
Since the relay daemon's peer can't know the session's id, the
session will never be referenced in the future. Moreover, the
session will never be tied to the connection(s) in order to bound
its lifetime.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
{
int ret = 0;
ssize_t send_ret;
- struct relay_session *session;
+ struct relay_session *session = NULL;
struct lttcomm_relayd_status_session reply;
char session_name[LTTNG_NAME_MAX];
char hostname[LTTNG_HOST_NAME_MAX];
send_ret);
ret = -1;
}
-
+ if (ret < 0 && session) {
+ session_put(session);
+ }
return ret;
}