pgpool2.git / summary / log / commit / refs
commit d213647a441de48e64179cbdaaed9109830a2ff3
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Fri Aug 02 04:03:13 2019 +0000
Fix segfaut in streaming replication check process.
In case of failure of pg_stat_replication() call, the streaming
replication check process unconditionally tried to free the allocated
memory. This should only be done when the call succeeds.
src/streaming_replication/pool_worker_child.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/streaming_replication/pool_worker_child.c b/src/streaming_replication/pool_worker_child.c
index d1ecc3bb7..a297be2e8 100644
--- a/src/streaming_replication/pool_worker_child.c
+++ b/src/streaming_replication/pool_worker_child.c
@@ -419,7 +419,8 @@ check_replication_time_lag(void)
}
}
}
- free_select_result(res_rep);
+ if (status == 0)
+ free_select_result(res_rep);
}
for (i = 0; i < NUM_BACKENDS; i++)
[parent: cc33ffccf663]