Re: Patch for PGunescapeBytea

From: Ben Lamb <pgsql-patches(at)zurgy(dot)org>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Patch for PGunescapeBytea
Date: 2003-05-08 10:54:22
Message-ID: 200305081154.22776.pgsql-patches@zurgy.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Here is a new patch for src/interfaces/libpq/fe-exec.c that incorporates the
change suggested by Magnus. The patch significantly improves the speed of
PGunescapeBytea().

Ben.

> [snip]
>
> I think these lines:
>
> buffer = realloc(buffer, buflen);
> ---
> if (buffer == NULL)
> return NULL;
> ---
>
> are wrong. Shouldn't one do:
> ---
> tmpbuf=realloc(buf,...);
> if (!tmpbuf)
> free(buf), return 0;
> ---
>
> to avoid a memory leak?
>
> ... just checking ;)
>
> Magnus

Attachment Content-Type Size
fe-exec.c.patch text/x-diff 3.3 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2003-05-08 12:06:20 Re: 2nd nested trasanctions supporting patch
Previous Message Bruce Momjian 2003-05-08 03:33:37 Pass shared memory address to exec'ed backend