Re: The Axe list - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: The Axe list
Date
Msg-id 20081012151033.GB14629@svana.org
Whole thread Raw
In response to Re: The Axe list  ("D'Arcy J.M. Cain" <darcy@druid.net>)
List pgsql-hackers
On Sun, Oct 12, 2008 at 10:41:21AM -0400, D'Arcy J.M. Cain wrote:
> > >  +   if ((result = (char *) palloc(16)) != NULL)
> > >  +   {
> > >  +       result[0] = ':';
> > >  +       strcpy(result + 1, password->password);
> > >  +   }
> >
> > AFAIK palloc() cannot return NULL?
>
> Really?  My program will simply come crashing down if there is a memory
> problem without giving me a chance to clean up?

If by "come crashing down" you mean "the transaction will be aborted,
all memory and other resources freed and the user gets a nice error
message", then yes. palloc will never return an invalid pointer.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: The Axe list
Next
From: "Hitoshi Harada"
Date:
Subject: Re: SELECT TOP %d PERCENT, or SELECT ... LIMIT %d PERCENT ?