curl-library
RE: Memory leaks using callbacks
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 13 Nov 2007 10:40:48 +0100 (CET)
Date: Tue, 13 Nov 2007 10:40:48 +0100 (CET)
On Tue, 13 Nov 2007, Raquel Vieira wrote:
Please don't top-post: http://curl.haxx.se/mail/etiquette.html#top-post
> 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.
Nope. The data is a pointer that is passed to your callback, modifying that
won't help. You need to make the pointer point to something in which you can
return data.
Your provided code was done wrong and leaks memory.
> I have already trying to use valgrind and it doesn't detect anything.
So you have a memory leak that valgrind can't find? That certainly is a new
thing to me...
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2007-11-13