From 4b554f2c401e0dbc3de6d8c41f88f2fc84450a41 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Sat, 15 Aug 2020 12:37:39 +0900 Subject: [PATCH] Fix oversight in connection_life_time fix. Commit 39eb90fe199d03253b99bec38d85c40f66aa55ab did not consider the case when node is down connection struct is NULL. As a result, segfault occurred. --- src/protocol/pool_connection_pool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/protocol/pool_connection_pool.c b/src/protocol/pool_connection_pool.c index 4148ee2da..b60a0acaa 100644 --- a/src/protocol/pool_connection_pool.c +++ b/src/protocol/pool_connection_pool.c @@ -344,7 +344,8 @@ pool_connection_pool_timer(POOL_CONNECTION_POOL * backend) /* Set connection close time */ for (i = 0; i < NUM_BACKENDS; i++) { - CONNECTION_SLOT(backend, i)->closetime = time(NULL); + if (CONNECTION_SLOT(backend, i)) + CONNECTION_SLOT(backend, i)->closetime = time(NULL); } if (pool_config->connection_life_time == 0) -- 2.39.5