pgpool2.git / summary / log / commit / refs
commit 162c7069ccdcffa444d0fd2b398af3f77cd59607
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Sat Oct 26 09:09:39 2013 +0000
Fix memory leak when do_query() fails.
Per Coverity report "1111444 Resource leak".
src/streaming_replication/pool_worker_child.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/streaming_replication/pool_worker_child.c b/src/streaming_replication/pool_worker_child.c
index 831a6b940..093c8cc2e 100644
--- a/src/streaming_replication/pool_worker_child.c
+++ b/src/streaming_replication/pool_worker_child.c
@@ -5,7 +5,7 @@
* pgpool: a language independent connection pool server for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2003-2012 PgPool Global Development Group
+ * Copyright (c) 2003-2013 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
@@ -249,6 +249,8 @@ static void check_replication_time_lag(void)
sts = do_query(slots[i]->con, query, &res, PROTO_MAJOR_V3);
if (sts != POOL_CONTINUE)
{
+ if (res)
+ free_select_result(res);
pool_error("check_replication_time_lag: %s failed", query);
return;
}
[parent: c025fe26303f]