mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Modify hash_create() to elog(ERROR) if an error occurs, rather than
returning a NULL pointer (some callers remembered to check the return value, but some did not -- it is safer to just bail out). Also, cleanup pgstat.c to use elog(ERROR) rather than elog(LOG) followed by exit().
This commit is contained in:
@ -2043,19 +2043,11 @@ static HTAB *
|
||||
createConnHash(void)
|
||||
{
|
||||
HASHCTL ctl;
|
||||
HTAB *ptr;
|
||||
|
||||
ctl.keysize = NAMEDATALEN;
|
||||
ctl.entrysize = sizeof(remoteConnHashEnt);
|
||||
|
||||
ptr = hash_create("Remote Con hash", NUMCONN, &ctl, HASH_ELEM);
|
||||
|
||||
if (!ptr)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OUT_OF_MEMORY),
|
||||
errmsg("out of memory")));
|
||||
|
||||
return (ptr);
|
||||
return hash_create("Remote Con hash", NUMCONN, &ctl, HASH_ELEM);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user