Re: BUG #18910: DEREF_OF_NULL.RET Pointer, returned from function 'palloc0' at simplehash.h:1080, may be NULL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: gorcom2012(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18910: DEREF_OF_NULL.RET Pointer, returned from function 'palloc0' at simplehash.h:1080, may be NULL
Date: 2025-05-05 14:43:07
Message-ID: 2643584.1746456187@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> In the file /src/include/lib/simplehash.h, within the SH_STAT() function,
> there is a call to palloc0() that may return NULL:
> uint32 *collisions = (uint32 *) palloc0(tb->size * sizeof(uint32));

palloc and its variants do not return NULL, unless you specify
MCXT_ALLOC_NO_OOM, which this call does not.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message vignesh C 2025-05-05 14:47:33 Re: BUG #18897: Logical replication conflict after using pg_createsubscriber under heavy load
Previous Message PG Bug reporting form 2025-05-05 14:30:49 BUG #18911: Bug in the command INHERITS.