Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: fe-exec.c.patch
Description: text/x-diff (3.3 KB)

In response to

Responses

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group