From: Jérémie Galarneau Date: Wed, 7 Apr 2021 16:51:36 +0000 (-0400) Subject: Fix: sessiond: notification: missing unlock on client list on error X-Git-Tag: v2.13.0-rc1~152 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=ecc7ed07fdfd1469f4b3c087e55cbae75f481e58 Fix: sessiond: notification: missing unlock on client list on error 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 --- 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; } }