Re: Check for failed memory allocations in libpq

From: Dave Allen <daveallen(at)acm(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Check for failed memory allocations in libpq
Date: 2003-07-31 20:33:32
Message-ID: 1059683611.1794.15.camel@shampoo.sysrq.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Apologies if I missed anything, but I thought I fixed any callers of
PQmakeEmptyPQresult that weren't already checking (parseInput and
getRowDescriptions were the only ones).

I of course can't fix any applications I don't have the source for, but
if I missed something in libpq, I'd be more than happy to go back and
try to fix it.

On Thu, 2003-07-31 at 07:05, Tom Lane wrote:
> Dave Allen <daveallen(at)acm(dot)org> writes:
> > Attached is a patch (against 7.3.4) to check the return values of some
> > calls (malloc, realloc, etc.) for failed memory allocations in libpq.
>
> You sure you aren't just trading one misbehavior for another? The
> change in PQmakeEmptyPGresult, for example, just moves the core dump
> somewhere else, unless you find reasonable fallbacks for *all* its
> callers (including applications you don't have the source code for,
> but in any case including every one of the calls in libpq).
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
--
Dave Allen
daveallen(at)acm(dot)org

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-07-31 20:48:27 Re: Check for failed memory allocations in libpq
Previous Message Joe Conway 2003-07-31 20:10:36 Re: preload libraries patch [was: [GENERAL] hexadecimal to decimal]