curl-library
RE: Memory leaks using callbacks
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
callback.
I have already trying to use valgrind and it doesn't detect anything.
Raquel Vieira
-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] 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
to
> 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
hope
I don't have to say more.
> CWebClient::HTTPWriteCallback(void *ptr, size_t size, size_t memb,
char*
> &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: http://haxx.se/curl.htmlReceived on 2007-11-13