cURL / Mailing Lists / curl-library / Single Mail


RE: Memory leaks using callbacks

From: Raquel Vieira <>
Date: Tue, 13 Nov 2007 09:28:04 -0000

The variable 'data' is the data that I'm returning from the callback.
I'm deleting that variable in the method httpPost that calls the

I have already trying to use valgrind and it doesn't detect anything.

Raquel Vieira

-----Original Message-----
[] On Behalf Of Daniel Stenberg
Sent: segunda-feira, 12 de Novembro de 2007 20:56
To: libcurl development
Subject: Re: Memory leaks using callbacks

On Mon, 12 Nov 2007, Raquel Vieira wrote:

> My application has memory leaks, and I'm having a lot of difficulties
> know why. I'm using libcurl 7.12.1 for RedHat.

That's the release of August 2004. Three years and three months later. I
I don't have to say more.

> CWebClient::HTTPWriteCallback(void *ptr, size_t size, size_t memb,
> &data)
> {
> data = new char[nRealsize+1];

> return nRealsize;

> }

I took the liberty of extracting the non-important code from your
callback and
left the above for you to look at once more...

  Commercial curl and libcurl Technical Support:
Received on 2007-11-13