X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.c;h=0ae6b0b6eb2cd2db217809a4d7ec2f9fecff52d9;hb=b2b89e8a85d9cb25396c4ec792c709065551659f;hp=4df1bdf3f46050f9ae00a279e1024693c6a995b7;hpb=8fd2c92c9864fd139539b7acbd31fbe4d2689ceb;p=lttng-tools.git diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 4df1bdf3f..0ae6b0b6e 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -519,10 +519,6 @@ struct lttng_handle *lttng_create_handle(const char *session_name, { struct lttng_handle *handle = NULL; - if (domain == NULL) { - goto end; - } - handle = zmalloc(sizeof(struct lttng_handle)); if (handle == NULL) { PERROR("malloc handle"); @@ -533,8 +529,10 @@ struct lttng_handle *lttng_create_handle(const char *session_name, lttng_ctl_copy_string(handle->session_name, session_name, sizeof(handle->session_name)); - /* Copy lttng domain */ - lttng_ctl_copy_lttng_domain(&handle->domain, domain); + /* Copy lttng domain or leave initialized to 0. */ + if (domain) { + lttng_ctl_copy_lttng_domain(&handle->domain, domain); + } end: return handle; @@ -2415,7 +2413,7 @@ end: /* * lib constructor. */ -static void __attribute__((constructor)) init() +static void __attribute__((constructor)) init(void) { /* Set default session group */ lttng_set_tracing_group(DEFAULT_TRACING_GROUP); @@ -2424,7 +2422,7 @@ static void __attribute__((constructor)) init() /* * lib destructor. */ -static void __attribute__((destructor)) lttng_ctl_exit() +static void __attribute__((destructor)) lttng_ctl_exit(void) { free(tracing_group); }