projects
/
pgpool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfef74f
)
Fix resource leak while reading startup packet.
author
Tatsuo Ishii
<ishii@postgresql.org>
Sat, 19 Jul 2025 06:48:37 +0000
(15:48 +0900)
committer
Tatsuo Ishii
<ishii@postgresql.org>
Sat, 19 Jul 2025 06:48:37 +0000
(15:48 +0900)
Per Coverity.
Backpatch-through: v4.2
src/protocol/child.c
patch
|
blob
|
blame
|
history
diff --git
a/src/protocol/child.c
b/src/protocol/child.c
index cf2161806b38d31d4497ddd03c478b666bda5f46..87de2caac10b7b3173ee230137b7d3d8d2d55878 100644
(file)
--- a/
src/protocol/child.c
+++ b/
src/protocol/child.c
@@
-772,8
+772,11
@@
read_startup_packet(POOL_CONNECTION *cp)
}
/* The database defaults to their user name. */
- if (sp->database == NULL || sp->database[0] == '\0')
+ if (sp->database == NULL)
+ sp->database = pstrdup(sp->user);
+ else if (sp->database[0] == '\0')
{
+ pfree(sp->database);
sp->database = pstrdup(sp->user);
}