a Coverity warning, these are risky since the hashtable isn't necessarily
fully set up yet. They're unnecessary anyway: a deletable hashtable
should be in a memory context that will be cleared following elog(ERROR).
Per report from Martijn van Oosterhout.
/* Build the hash directory structure */
if (!init_htab(hashp, nelem))
- {
- hash_destroy(hashp);
elog(ERROR, "failed to initialize hash table");
- }
/*
* For a shared hash table, preallocate the requested number of elements.
nelem < hctl->nelem_alloc)
{
if (!element_alloc(hashp, (int) nelem))
- {
- hash_destroy(hashp);
ereport(ERROR,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory")));
- }
}
return hashp;