projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: Relayd and consumerd socket leaks
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.c
diff --git
a/src/bin/lttng-sessiond/cmd.c
b/src/bin/lttng-sessiond/cmd.c
index 460f1d69fda2672cadbcb35a2992d4ba2a208a1c..d1417efd76e52409be5573497d3ad0010b849ad9 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-522,6
+522,12
@@
static int send_consumer_relayd_socket(int domain, struct ltt_session *session,
int ret;
struct lttcomm_sock *sock = NULL;
int ret;
struct lttcomm_sock *sock = NULL;
+ /* Don't resend the sockets to the consumer. */
+ if (consumer->dst.net.relayd_socks_sent) {
+ ret = LTTNG_OK;
+ goto error;
+ }
+
/* Set the network sequence index if not set. */
if (consumer->net_seq_index == -1) {
/*
/* Set the network sequence index if not set. */
if (consumer->net_seq_index == -1) {
/*
@@
-566,6
+572,7
@@
close_sock:
lttcomm_destroy_sock(sock);
}
lttcomm_destroy_sock(sock);
}
+error:
return ret;
}
return ret;
}
@@
-1928,6
+1935,9
@@
ssize_t cmd_list_channels(int domain, struct ltt_session *session,
nb_chan = session->kernel_session->channel_count;
}
DBG3("Number of kernel channels %zd", nb_chan);
nb_chan = session->kernel_session->channel_count;
}
DBG3("Number of kernel channels %zd", nb_chan);
+ if (nb_chan <= 0) {
+ ret = LTTNG_ERR_KERN_CHAN_NOT_FOUND;
+ }
break;
case LTTNG_DOMAIN_UST:
if (session->ust_session != NULL) {
break;
case LTTNG_DOMAIN_UST:
if (session->ust_session != NULL) {
@@
-1935,6
+1945,9
@@
ssize_t cmd_list_channels(int domain, struct ltt_session *session,
session->ust_session->domain_global.channels);
}
DBG3("Number of UST global channels %zd", nb_chan);
session->ust_session->domain_global.channels);
}
DBG3("Number of UST global channels %zd", nb_chan);
+ if (nb_chan <= 0) {
+ ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
+ }
break;
default:
*channels = NULL;
break;
default:
*channels = NULL;
@@
-1952,6
+1965,8
@@
ssize_t cmd_list_channels(int domain, struct ltt_session *session,
list_lttng_channels(domain, session, *channels);
} else {
*channels = NULL;
list_lttng_channels(domain, session, *channels);
} else {
*channels = NULL;
+ /* Ret value was set in the domain switch case */
+ goto error;
}
return nb_chan;
}
return nb_chan;
This page took
0.029122 seconds
and
4
git commands to generate.