From: Tatsuo Ishii Date: Sat, 19 Jul 2025 06:43:11 +0000 (+0900) Subject: Fix memory leak. X-Git-Tag: V4_5_8~10 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=70e7feb62a4f1f9f8bf58151a4d528bf9775f476;p=pgpool2.git Fix memory leak. Fix resource leak in pool_push_pending_data pointed out by Coverity. Backpatch-through: v4.2 --- diff --git a/src/protocol/pool_process_query.c b/src/protocol/pool_process_query.c index 15b0f41f0..0059c88fe 100644 --- a/src/protocol/pool_process_query.c +++ b/src/protocol/pool_process_query.c @@ -5261,6 +5261,7 @@ pool_push_pending_data(POOL_CONNECTION * backend) { pool_push(backend, buf, len); pfree(buf); + buf = NULL; } data_pushed = true; if (kind == 'E') @@ -5269,6 +5270,8 @@ pool_push_pending_data(POOL_CONNECTION * backend) ereport(DEBUG1, (errmsg("pool_push_pending_data: ERROR response found"))); pool_set_ignore_till_sync(); + if (buf) + pfree(buf); break; } num_pushed_messages++;