projects
/
pgpool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a05498
)
Fix memory leak pointed out by Coverity.
author
Tatsuo Ishii
<ishii@sraoss.co.jp>
Wed, 2 Feb 2022 01:19:26 +0000
(10:19 +0900)
committer
Tatsuo Ishii
<ishii@sraoss.co.jp>
Wed, 2 Feb 2022 01:19:26 +0000
(10:19 +0900)
Actually it's a false positive.
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 b996cd0a6a4b90878fccc0b78844cb36dcb1aa0d..9433fbb93606c611362d56e954315e4c007cb50f 100644
(file)
--- a/
src/protocol/pool_process_query.c
+++ b/
src/protocol/pool_process_query.c
@@
-949,6
+949,16
@@
ParameterStatus(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend)
int pos;
len1 = len;
+ /*
+ * To suppress Coverity false positive warning. Actually
+ * being IS_MAIN_NODE_ID(i)) true only happens in a loop. So
+ * we don't need to worry about to leak memory previously
+ * allocated in parambuf. But Coverity is not smart enough
+ * to realize it.
+ */
+ if (parambuf)
+ pfree(parambuf);
+
parambuf = palloc(len);
memcpy(parambuf, p, len);
pool_add_param(&CONNECTION(backend, i)->params, name, value);