Clean-up: sessiond: ust-app: ua_sess is never populated on failure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 15 May 2023 19:49:04 +0000 (15:49 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 15 Jun 2023 15:56:25 +0000 (11:56 -0400)
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 <jeremie.galarneau@efficios.com>
Change-Id: I8f5cc75f718d96d32fb67fc67135034eb95365d7

src/bin/lttng-sessiond/ust-app.cpp

index d7b1275b0814571eece6f951fda7bd23d2247512..c985fd8ac9ab5a0d36cb3a008366f788eb3fed2a 100644 (file)
@@ -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);
This page took 0.028803 seconds and 4 git commands to generate.