Re: BUG #16190: The usage of NULL pointer in refint.c - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16190: The usage of NULL pointer in refint.c
Date
Msg-id 7984.1578363125@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #16190: The usage of NULL pointer in refint.c  (Michael Paquier <michael@paquier.xyz>)
Responses Re: BUG #16190: The usage of NULL pointer in refint.c  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
Michael Paquier <michael@paquier.xyz> writes:
> On Mon, Jan 06, 2020 at 09:44:43AM -0800, Andres Freund wrote:
>> I think we should consider either moving this out of contrib, or fixing
>> it up. test/example code is fine, but contrib gets installed by default
>> for a lot of people... And yea, this isn't just about contrib/spi.

> No idea about moving that out of contrib/, but here is a patch to fix
> things that just moves the allocations to TopMemoryContext and removes
> the system calls.

WFM.  There are probably more elegant ways to do it than to drop this
stuff into TopMemoryContext, but this is surely better than unchecked
malloc calls.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #16190: The usage of NULL pointer in refint.c
Next
From: Andres Freund
Date:
Subject: Re: BUG #16190: The usage of NULL pointer in refint.c