Re: [HACKERS] compile warning in CVS HEAD - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: [HACKERS] compile warning in CVS HEAD
Date
Msg-id 405A479E.1010102@dunslane.net
Whole thread Raw
In response to Re: [HACKERS] compile warning in CVS HEAD  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches

Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.net> writes:
>
>
>>Patch attached. Also adds a malloc() check that Neil wanted.
>>
>>
>
>Er, what on God's green earth is elog.c doing malloc'ing stuff at all?
>This should be a palloc in the ErrorContext; that's what it's for.
>As is, this code is guaranteed to fail under out-of-memory conditions.
>
>
>

Well, it's a one-off allocation into a static variable, if that makes
any difference. If not, I accept the rebuke :-)

I first published the ancestor of this code many months ago, and nobody
has objected until now. But there is always room for improvement I
guess, including in my own knowledge. I'll be happy to change it if need be.

cheers

andrew


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] compile warning in CVS HEAD
Next
From: Robert Treat
Date:
Subject: FAQ updates