[lttng-tools] Fix: Null check before destroying health_sessiond
diff mbox series

Message ID 20190920151512.12956-1-jonathan.rajotte-julien@efficios.com
State Accepted, archived
Headers show
Series
  • [lttng-tools] Fix: Null check before destroying health_sessiond
Related show

Commit Message

Jonathan Rajotte Sept. 20, 2019, 3:15 p.m. UTC
Fixes coverity #1399735

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 src/bin/lttng-sessiond/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jérémie Galarneau Sept. 20, 2019, 9:24 p.m. UTC | #1
Merged in master and stable-2.11. Thanks!

J?r?mie

On Fri, Sep 20, 2019 at 11:15:12AM -0400, Jonathan Rajotte wrote:
> Fixes coverity #1399735
> 
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
> ---
>  src/bin/lttng-sessiond/main.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c
> index 5f99bdbf6..a428630f8 100644
> --- a/src/bin/lttng-sessiond/main.c
> +++ b/src/bin/lttng-sessiond/main.c
> @@ -1819,7 +1819,9 @@ stop_threads:
>  	lttng_pipe_destroy(ust64_channel_monitor_pipe);
>  	lttng_pipe_destroy(kernel_channel_monitor_pipe);
>  
> -	health_app_destroy(health_sessiond);
> +	if (health_sessiond) {
> +		health_app_destroy(health_sessiond);
> +	}
>  exit_create_run_as_worker_cleanup:
>  exit_options:
>  	sessiond_cleanup_lock_file();
> -- 
> 2.17.1
>

Patch
diff mbox series

diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c
index 5f99bdbf6..a428630f8 100644
--- a/src/bin/lttng-sessiond/main.c
+++ b/src/bin/lttng-sessiond/main.c
@@ -1819,7 +1819,9 @@  stop_threads:
 	lttng_pipe_destroy(ust64_channel_monitor_pipe);
 	lttng_pipe_destroy(kernel_channel_monitor_pipe);
 
-	health_app_destroy(health_sessiond);
+	if (health_sessiond) {
+		health_app_destroy(health_sessiond);
+	}
 exit_create_run_as_worker_cleanup:
 exit_options:
 	sessiond_cleanup_lock_file();