Fix: add missing buffer registry cleanup on error
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index dfc4599be858315b3a2b25956b0daa49e9d24bd2..4fb23b627921ed2266ab9d885dd94993ffa9133e 100644 (file)
@@ -2246,6 +2246,14 @@ static int create_channel_per_uid(struct ust_app *app,
                ret = do_consumer_create_channel(usess, ua_sess, ua_chan,
                                app->bits_per_long, reg_uid->registry->reg.ust);
                if (ret < 0) {
+                       /*
+                        * Let's remove the previously created buffer registry channel so
+                        * it's not visible anymore in the session registry.
+                        */
+                       ust_registry_channel_del_free(reg_uid->registry->reg.ust,
+                                       ua_chan->tracing_channel_id);
+                       buffer_reg_channel_remove(reg_uid->registry, reg_chan);
+                       buffer_reg_channel_destroy(reg_chan, LTTNG_DOMAIN_UST);
                        goto error;
                }
 
This page took 0.02403 seconds and 4 git commands to generate.