Fix: destroy called twice on quit pipe
[lttng-tools.git] / src / bin / lttng-sessiond / manage-consumer.c
index 47bfe521cf96056b2ffd7dd111afda69efb0b7e5..b710c61f80ed3d837aa03a92c511e0176e13fd10 100644 (file)
@@ -447,13 +447,13 @@ bool launch_consumer_management_thread(struct consumer_data *consumer_data)
        struct thread_notifiers *notifiers = NULL;
        struct lttng_thread *thread;
 
-       quit_pipe = lttng_pipe_open(FD_CLOEXEC);
-       if (!quit_pipe) {
-               goto error;
-       }
-
        notifiers = zmalloc(sizeof(*notifiers));
        if (!notifiers) {
+               goto error_alloc;
+       }
+
+       quit_pipe = lttng_pipe_open(FD_CLOEXEC);
+       if (!quit_pipe) {
                goto error;
        }
        notifiers->quit_pipe = quit_pipe;
@@ -471,10 +471,11 @@ bool launch_consumer_management_thread(struct consumer_data *consumer_data)
        wait_until_thread_is_ready(notifiers);
        lttng_thread_put(thread);
        if (notifiers->initialization_result) {
-               goto error;
+               return false;
        }
        return true;
 error:
        cleanup_consumer_management_thread(notifiers);
+error_alloc:
        return false;
 }
This page took 0.029521 seconds and 5 git commands to generate.