From a57a7f22e21b8b5dbb32e6b0096c81e869543aa2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 5 Oct 2018 12:06:37 -0400 Subject: [PATCH] Remove unnecessary check of output parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It is not necessary to check for `_notification != NULL` as it is done at the beginning of the function. Moreover, it confuses Coverity which warns that `notification` will be leaked if the output parameter is NULL. Signed-off-by: Jérémie Galarneau --- src/lib/lttng-ctl/channel.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/lttng-ctl/channel.c b/src/lib/lttng-ctl/channel.c index 5487d051b..5271aa13f 100644 --- a/src/lib/lttng-ctl/channel.c +++ b/src/lib/lttng-ctl/channel.c @@ -289,10 +289,8 @@ lttng_notification_channel_get_next_notification( end_unlock: pthread_mutex_unlock(&channel->lock); + *_notification = notification; end: - if (_notification) { - *_notification = notification; - } return status; } -- 2.34.1