From 8ec05b28b712fa4b2de5cc088ee978e05cd7e69a Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Mon, 25 Oct 2004 00:46:43 +0000 Subject: 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(). --- contrib/dblink/dblink.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'contrib/dblink') diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index 2b33043c5a..f6c95ef1dc 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -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 -- cgit v1.2.1