From: Jérémie Galarneau Date: Mon, 15 May 2023 19:49:04 +0000 (-0400) Subject: Clean-up: sessiond: ust-app: ua_sess is never populated on failure X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6d2f8aae34a4e1e219a29db407dd0ea6805b690b;p=lttng-tools.git Clean-up: sessiond: ust-app: ua_sess is never populated on failure When find_or_create_ust_app_session() fails, it doesn't populate its return parameter. Therefore, it is unnecessary to destroy the app session when it returns < 0. Signed-off-by: Jérémie Galarneau Change-Id: I8f5cc75f718d96d32fb67fc67135034eb95365d7 --- diff --git a/src/bin/lttng-sessiond/ust-app.cpp b/src/bin/lttng-sessiond/ust-app.cpp index d7b1275b0..c985fd8ac 100644 --- a/src/bin/lttng-sessiond/ust-app.cpp +++ b/src/bin/lttng-sessiond/ust-app.cpp @@ -6192,11 +6192,9 @@ static void ust_app_synchronize(struct ltt_ust_session *usess, struct ust_app *a ret = find_or_create_ust_app_session(usess, app, &ua_sess, nullptr); if (ret < 0) { /* Tracer is probably gone or ENOMEM. */ - if (ua_sess) { - destroy_app_session(app, ua_sess); - } goto end; } + LTTNG_ASSERT(ua_sess); pthread_mutex_lock(&ua_sess->lock);