pgpool2.git / summary / log / commit / refs
commit 745cec02a4b2c6e98b444b4b4e149632392365bb
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Sat Aug 15 03:37:39 2020 +0000
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 0c77cbfca..059543356 100644
--- a/src/protocol/pool_connection_pool.c
+++ b/src/protocol/pool_connection_pool.c
@@ -350,7 +350,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)
[parent: 1afc6431bc27]