Re: Libpq memory leak

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Polyakov Vladimir <vvpolyakov(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Libpq memory leak
Date: 2010-09-24 14:06:29
Message-ID: 14007.1285337189@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Polyakov Vladimir <vvpolyakov(at)gmail(dot)com> writes:
> 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;

When you break it, you get to keep both pieces. Whatever gave you
the idea that the above would be considered a supported thing to do?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dmitriy Igrishin 2010-09-24 14:11:31 Re: Libpq memory leak
Previous Message Raymond O'Donnell 2010-09-24 12:40:57 Re: Restore/dump from "/usr/local/pgsql/data" directory