projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: Read from pointer after free
[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 4fcd6a4feafdf2eae0b1e4393dd69ecfd6716d5e..4eacb3c890ff27f33d5a985b868a68dce7d65abc 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-110,7
+110,7
@@
static int build_network_session_path(char *dst, size_t size,
tmp_urls, kdata_port, tmp_uurl, udata_port);
} else {
int dport;
tmp_urls, kdata_port, tmp_uurl, udata_port);
} else {
int dport;
- if (kuri) {
+ if (kuri
|| (!kuri && !uuri)
) {
dport = kdata_port;
} else {
/* No kernel URI, use the UST port. */
dport = kdata_port;
} else {
/* No kernel URI, use the UST port. */
@@
-1106,7
+1106,7
@@
int cmd_add_context(struct ltt_session *session, int domain,
if (chan_count == 0) {
struct lttng_channel *attr;
/* Create default channel */
if (chan_count == 0) {
struct lttng_channel *attr;
/* Create default channel */
- attr = channel_new_default_attr(domain);
+ attr = channel_new_default_attr(domain
, usess->buffer_type
);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1166,7
+1166,8
@@
int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain,
kchan = trace_kernel_get_channel_by_name(channel_name,
session->kernel_session);
if (kchan == NULL) {
kchan = trace_kernel_get_channel_by_name(channel_name,
session->kernel_session);
if (kchan == NULL) {
- attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL,
+ LTTNG_BUFFER_GLOBAL);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1216,7
+1217,8
@@
int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain,
channel_name);
if (uchan == NULL) {
/* Create default channel */
channel_name);
if (uchan == NULL) {
/* Create default channel */
- attr = channel_new_default_attr(LTTNG_DOMAIN_UST);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_UST,
+ usess->buffer_type);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1286,7
+1288,8
@@
int cmd_enable_event_all(struct ltt_session *session,
session->kernel_session);
if (kchan == NULL) {
/* Create default channel */
session->kernel_session);
if (kchan == NULL) {
/* Create default channel */
- attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL,
+ LTTNG_BUFFER_GLOBAL);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1350,7
+1353,8
@@
int cmd_enable_event_all(struct ltt_session *session,
channel_name);
if (uchan == NULL) {
/* Create default channel */
channel_name);
if (uchan == NULL) {
/* Create default channel */
- attr = channel_new_default_attr(LTTNG_DOMAIN_UST);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_UST,
+ usess->buffer_type);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
@@
-1827,7
+1831,7
@@
int cmd_register_consumer(struct ltt_session *session, int domain,
const char *sock_path, struct consumer_data *cdata)
{
int ret, sock;
const char *sock_path, struct consumer_data *cdata)
{
int ret, sock;
- struct consumer_socket *socket;
+ struct consumer_socket *socket
= NULL
;
assert(session);
assert(cdata);
assert(session);
assert(cdata);
@@
-1887,9
+1891,12
@@
int cmd_register_consumer(struct ltt_session *session, int domain,
goto error;
}
goto error;
}
- ret
=
LTTNG_OK;
+ ret
urn
LTTNG_OK;
error:
error:
+ if (socket) {
+ consumer_destroy_socket(socket);
+ }
return ret;
}
return ret;
}
This page took
0.025816 seconds
and
4
git commands to generate.