hello,

it was found by Coverity
From bac4e3e88260bab3db6650f43ac53a1e2771242e Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <chipits...@gmail.com>
Date: Thu, 25 Jul 2019 16:47:58 +0500
Subject: [PATCH] src/checks.c: resolve possible null pointer dereference found
 by Coverity

---
 src/checks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/checks.c b/src/checks.c
index d91e23922..b10bbb406 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -3210,7 +3210,7 @@ static int tcpcheck_main(struct check *check)
 	/* cleanup before leaving */
 	check->current_step = NULL;
 
-	if (check->result == CHK_RES_FAILED)
+	if (conn && (check->result == CHK_RES_FAILED))
 		conn->flags |= CO_FL_ERROR;
 
  out:
-- 
2.20.1

Reply via email to