Fix: loading of live session within userspace domains
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.c
index 615bf796f5aedae7ae607502b2a514f3d887d0e0..b190937cc8f42478e51612c3df7abc665e01728f 100644 (file)
@@ -486,10 +486,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");
@@ -500,8 +496,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;
This page took 0.023078 seconds and 4 git commands to generate.