reallocing without oom check in pg_regress

Started by Daniel Gustafssonabout 4 years ago3 messageshackers
Jump to latest
#1Daniel Gustafsson
daniel@yesql.se

In pg_regress we realloc() with the destination and source pointer being equal,
without checking for OOM. While a fairly unlikely source of errors, is there a
reason not to use pg_realloc() there for hygiene?

--
Daniel Gustafsson https://vmware.com/

Attachments:

pg_regress_realloc.diffapplication/octet-stream; name=pg_regress_realloc.diff; x-unix-mode=0644Download+1-1
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Gustafsson (#1)
Re: reallocing without oom check in pg_regress

Daniel Gustafsson <daniel@yesql.se> writes:

In pg_regress we realloc() with the destination and source pointer being equal,
without checking for OOM. While a fairly unlikely source of errors, is there a
reason not to use pg_realloc() there for hygiene?

Yeah, looks like oversight to me.

regards, tom lane

#3Daniel Gustafsson
daniel@yesql.se
In reply to: Tom Lane (#2)
Re: reallocing without oom check in pg_regress

On 23 Feb 2022, at 23:05, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Daniel Gustafsson <daniel@yesql.se> writes:

In pg_regress we realloc() with the destination and source pointer being equal,
without checking for OOM. While a fairly unlikely source of errors, is there a
reason not to use pg_realloc() there for hygiene?

Yeah, looks like oversight to me.

Thanks for confirming, I've pushed this now after taking it for a spin on the
CI just in case.

--
Daniel Gustafsson https://vmware.com/