projects
/
pgpool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70e7feb
)
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 07:02:40 +0000
(16:02 +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 53a4cce68dcebc021840f70f9b953d49ca83d488..5ccc1b0749952dc4d72c8565c63d0ca3c124a5c5 100644
(file)
--- a/
src/protocol/child.c
+++ b/
src/protocol/child.c
@@
-778,8
+778,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);
}