Fix: handle error if metadata fails to be created
authorDavid Goulet <dgoulet@efficios.com>
Thu, 21 Mar 2013 19:21:56 +0000 (15:21 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 21 Mar 2013 19:22:01 +0000 (15:22 -0400)
Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/ust-app.c

index 3abdefd7d5601c898c3305f1552bd96fbb6b014d..979ae7c3c7659c97997649b5d477c68ecf47e7da 100644 (file)
@@ -3903,6 +3903,9 @@ void ust_app_global_update(struct ltt_ust_session *usess, int sock)
                                        sizeof(ua_chan->name))) {
                        ret = create_ust_app_metadata(ua_sess, app, usess->consumer,
                                        &ua_chan->attr);
+                       if (ret < 0) {
+                               goto error_unlock;
+                       }
                        /* Remove it from the hash table and continue!. */
                        ret = lttng_ht_del(ua_sess->channels, &iter);
                        assert(!ret);
@@ -3910,14 +3913,14 @@ void ust_app_global_update(struct ltt_ust_session *usess, int sock)
                        continue;
                } else {
                        ret = do_create_channel(app, usess, ua_sess, ua_chan);
-               }
-               if (ret < 0) {
-                       /*
-                        * Stop everything. On error, the application failed, no more
-                        * file descriptor are available or ENOMEM so stopping here is
-                        * the only thing we can do for now.
-                        */
-                       goto error_unlock;
+                       if (ret < 0) {
+                               /*
+                                * Stop everything. On error, the application failed, no more
+                                * file descriptor are available or ENOMEM so stopping here is
+                                * the only thing we can do for now.
+                                */
+                               goto error_unlock;
+                       }
                }
 
                cds_lfht_for_each_entry(ua_chan->ctx->ht, &iter_ctx.iter, ua_ctx,
This page took 0.027175 seconds and 4 git commands to generate.