Libpq memory leak

From: Polyakov Vladimir <vvpolyakov(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Libpq memory leak
Date: 2010-09-24 11:51:37
Message-ID: AANLkTi=Cia=6ZnWFVLQ3eeJwz7aj1Te33qVKCRFi7BJ4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Program written in C using Libpq, which receives large files (BYTEA)
has a memory leak.
I need to free ALL of the used memory after each sql query.

after each call PQclear() I drop the buffer:
conn->inBuffer = realloc(conn->inBuffer, 8192);
conn->inBufSize = 8192;

It works, but ..
I noticed that in some cases PQclear() does not clear the memory.
This happens only when the program receives certain files...

Maybe there's some buffers that should make realloc()?
Or is it a bug?

versions tested 9.0.0 and 8.4.4

Responses

Browse pgsql-general by date

  From Date Subject
Next Message kongsgar 2010-09-24 12:21:03 Re: Restore/dump from "/usr/local/pgsql/data" directory
Previous Message Craig Ringer 2010-09-24 11:30:31 Re: Restore/dump from "/usr/local/pgsql/data" directory