From ecc7ed07fdfd1469f4b3c087e55cbae75f481e58 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 7 Apr 2021 12:51:36 -0400 Subject: [PATCH] Fix: sessiond: notification: missing unlock on client list on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Change-Id: Iabfe3eecfbea89c96c7f16fbb25a0beef48f78b7 --- src/bin/lttng-sessiond/notification-thread-events.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 4623ef38c..0836620b5 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -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; } } -- 2.34.1