Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane escribi�:
>> One thing I was wondering about earlier today is whether libxml isn't
>> expecting NULL-return-on-failure from the malloc-substitute routine.
>> If we take control away from it unexpectedly, I wouldn't be a bit
>> surprised if its data structures are left corrupt. This might lead to
>> failures during cleanup.
> Hmm, this is a very good point. I quick look at the source shows that
> they are not very consistent on its own checking for memory allocation
> errors. For example, see a bug I just reported:
> http://bugzilla.gnome.org/show_bug.cgi?id=508662
Ugh. So we're pretty much damned if we do and damned if we don't.
Given what you showed, it is certain that we are at risk if we return
NULL, whereas it is merely hypothetical that we are at risk if we
longjmp. So let's stick to the palloc infrastructure for now.
regards, tom lane