Fix: Cleanup UST app session on ustctl create session error
authorDavid Goulet <dgoulet@efficios.com>
Mon, 29 Oct 2012 18:49:50 +0000 (14:49 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 29 Oct 2012 18:49:50 +0000 (14:49 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/ust-app.c

index 6f73c6df34a4006353ab1796e35743c51b2dd2a2..96f8eb0b3ead316c0defa96905ff40cfcccb3136 100644 (file)
@@ -976,9 +976,10 @@ static struct ust_app_session *create_ust_app_session(
                ret = ustctl_create_session(app->sock);
                if (ret < 0) {
                        ERR("Creating session for app pid %d", app->pid);
+                       delete_ust_app_session(-1, ua_sess);
                        /* This means that the tracer is gone... */
                        ua_sess = (void*) -1UL;
-                       goto error;
+                       goto end;
                }
 
                ua_sess->handle = ret;
@@ -993,11 +994,6 @@ static struct ust_app_session *create_ust_app_session(
 end:
        health_code_update(&health_thread_cmd);
        return ua_sess;
-
-error:
-       delete_ust_app_session(-1, ua_sess);
-       health_code_update(&health_thread_cmd);
-       return NULL;
 }
 
 /*
This page took 0.030099 seconds and 4 git commands to generate.