Ben Lamb <pgsql-patches@zurgy.org> wrote:
>> Hi,
>>
>> I found the libpq function PGunescapeBytea a little slow. It was
>> taking a minute and a half to decode a 500Kb on a fairly fast
>> machine. I think the culprit is sscanf.
[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