Fix: sessiond: notification: missing unlock on client list on error
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Apr 2021 16:51:36 +0000 (12:51 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Apr 2021 16:55:51 +0000 (12:55 -0400)
1452204 Missing unlock

May result in deadlock if there is another attempt to acquire the lock.

In notification_thread_client_subscribe: Missing a release of a lock on a path (CWE-667)

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Iabfe3eecfbea89c96c7f16fbb25a0beef48f78b7

src/bin/lttng-sessiond/notification-thread-events.c

index 4623ef38c463edb281a6eaaaedfdb8521dfb4db6..0836620b59262413c43b8cb97addb8e0f468746b 100644 (file)
@@ -1152,6 +1152,7 @@ int notification_thread_client_subscribe(struct notification_client *client,
                        WARN("[notification-thread] Evaluation of a condition on client subscription failed, aborting.");
                        ret = -1;
                        free(client_list_element);
+                       pthread_mutex_unlock(&client_list->lock);
                        goto end;
                }
        }
This page took 0.027444 seconds and 4 git commands to generate.