From a78732df66cfebdc51cf79dc60ceba21cffe6d3a Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 3 Dec 2012 14:34:45 -0500 Subject: [PATCH] Fix: Delete UST app session on ustctl create error This has been updated in upstream master (see commit: 0f83395d5e0e927fdab025eae023e68e9021af26). There was also a check missing at one of the callsite. http://lists.lttng.org/pipermail/lttng-dev/2012-December/019208.html Reported-by: David OShea Signed-off-by: David Goulet --- src/bin/lttng-sessiond/ust-app.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 28b761dc5..5380450f6 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -894,8 +894,9 @@ static struct ust_app_session *create_ust_app_session( if (ret < 0) { ERR("Creating session for app pid %d", app->pid); /* This means that the tracer is gone... */ + delete_ust_app_session(-1, ua_sess); ua_sess = (void*) -1UL; - goto error; + goto end; } ua_sess->handle = ret; @@ -909,10 +910,6 @@ static struct ust_app_session *create_ust_app_session( end: return ua_sess; - -error: - delete_ust_app_session(-1, ua_sess); - return NULL; } /* @@ -2307,7 +2304,7 @@ void ust_app_global_update(struct ltt_ust_session *usess, int sock) } ua_sess = create_ust_app_session(usess, app); - if (ua_sess == NULL) { + if (ua_sess == NULL || ua_sess == (void *) -1UL) { goto error; } -- 2.34.1