Re: pg_dump vs malloc

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump vs malloc
Date: 2011-06-22 19:26:44
Message-ID: 1308770768-sup-8304@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Excerpts from Magnus Hagander's message of mié jun 22 11:25:43 -0400 2011:
> On Fri, Jun 10, 2011 at 21:07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Magnus Hagander <magnus(at)hagander(dot)net> writes:
> >> I came across a situation today with a pretty bad crash of pg_dump,
> >> due to not checking the return code from malloc(). When looking
> >> through the code, it seems there are a *lot* of places in pg_dump that
> >> doesn't check the malloc return code.
> >
> >> But we do have a pg_malloc() function in there - but from what I can
> >> tell it's only used very sparsely?
> >
> >> Shouldn't we be using that one more or less everywhere
> >
> > Yup.  Have at it.
>
> Something along the line of this?

Huh, do you really need a new file for the four new functions? What's
wrong with common.c?

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2011-06-22 19:29:33 Re: Indication of db-shared tables
Previous Message Bruce Momjian 2011-06-22 19:24:40 Re: Indication of db-shared tables