cURL / Mailing Lists / curl-library / Single Mail


Re: Memory leaks using callbacks

From: Daniel Stenberg <>
Date: Mon, 12 Nov 2007 21:56:02 +0100 (CET)

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:
Received on 2007-11-12