projects
/
pgpool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a6a404
)
Fix memory leak.
author
Tatsuo Ishii
<ishii@postgresql.org>
Sat, 19 Jul 2025 06:43:11 +0000
(15:43 +0900)
committer
Tatsuo Ishii
<ishii@postgresql.org>
Sat, 19 Jul 2025 06:44:21 +0000
(15:44 +0900)
Fix resource leak in pool_push_pending_data pointed out by Coverity.
Backpatch-through: v4.2
src/protocol/pool_process_query.c
patch
|
blob
|
blame
|
history
diff --git
a/src/protocol/pool_process_query.c
b/src/protocol/pool_process_query.c
index 15b0f41f0e42a7a1446c814149951b7865170b4f..0059c88fe5cecfd92b54f87eacc40528f2894511 100644
(file)
--- 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++;