From 0f83395d5e0e927fdab025eae023e68e9021af26 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 29 Oct 2012 14:49:50 -0400 Subject: [PATCH] Fix: Cleanup UST app session on ustctl create session error Signed-off-by: David Goulet --- src/bin/lttng-sessiond/ust-app.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 6f73c6df3..96f8eb0b3 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -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; } /* -- 2.34.1