mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
libpq: pass a memory allocation failure error up to PQconndefaults()
Previously user name memory allocation failures were ignored and the default user name set to NULL.
This commit is contained in:
@ -4482,6 +4482,13 @@ conninfo_add_defaults(PQconninfoOption *options, PQExpBuffer errorMessage)
|
||||
if (strcmp(option->keyword, "user") == 0)
|
||||
{
|
||||
option->val = pg_fe_getauthname();
|
||||
if (!option->val)
|
||||
{
|
||||
if (errorMessage)
|
||||
printfPQExpBuffer(errorMessage,
|
||||
libpq_gettext("out of memory\n"));
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user