Re: BUG #18845: DEREF_OF_NULL.RET guc_malloc possibly returns NULL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: pm91(dot)arapov(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18845: DEREF_OF_NULL.RET guc_malloc possibly returns NULL
Date: 2025-03-14 14:04:59
Message-ID: 3051193.1741961099@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
> Why would we want FATAL here? Wouldn't it be better to return false like how
> other check_ functions already do?

Indeed. Also, a quick survey shows a lot of inconsistency in
guc_malloc callers --- some are lazy and just use ERROR rather
than LOG-and-return. That's probably all right for PGC_POSTMASTER
variables (since there's no chance of continuing anyway) but
perhaps it's worth improving elsewhere.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2025-03-14 14:08:38 Re: BUG #18845: DEREF_OF_NULL.RET guc_malloc possibly returns NULL
Previous Message Viktor Holmberg 2025-03-14 13:58:25 Re: ISN extension - wrong volatility level for isn_weak() function