diff options
Diffstat (limited to 'src/protocol/child.c')
-rw-r--r-- | src/protocol/child.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/protocol/child.c b/src/protocol/child.c index cf2161806..87de2caac 100644 --- 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); } |