Remove unnecessary check of output parameter
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 5 Oct 2018 16:06:37 +0000 (12:06 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 5 Oct 2018 16:08:21 +0000 (12:08 -0400)
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 <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/channel.c

index 5487d051b5013fd60b080491ce865966bc6ffeab..5271aa13fbd76218fca47b8984c6a055fc84b35f 100644 (file)
@@ -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;
 }
 
This page took 0.034043 seconds and 4 git commands to generate.