cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem caused by CURLDEBUG

From: James Housley <jim_at_thehousleys.net>
Date: Sun, 22 Oct 2006 20:33:45 -0400

On Oct 22, 2006, at 6:11 PM, Daniel Stenberg wrote:

> On Sun, 22 Oct 2006, James Housley wrote:
>
>> The default mode of CURLDEBUG is to map free() to curl_dofree(),
>> which is fine most of the time. However, if an external library
>> does memory allocation it is not possible to free the memory
>> without an error or warning.
>
> Sure there is, you can use (free)(ptr). But of course there's been
> no NO need for such a call yet, so I think that's a fine reason for
> free() to work as it does.
>
> I'd say that the best approach is to add wrappers for the new
> memory allocating functions too, so that the memory leak/track
> system works for these too.
>
> Are you referring to some libssh2 calls?

And it looks like all is good, because http://www.libssh2.org/wiki/
index.php/Callbacks . I just pass in the correct functions and they
will be used. I would need to write wrapper functions for
curl_domalloc() since libssh2 doesn't pass in the 2 extra parameters,
but it would be a step in the right direction.

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
jim@TheHousleys.Net  http://www.TheHousleys.net
---------------------------------------------------------------------
The wise man built his network upon Un*x.
     The foolish man built his network upon Windows.
Received on 2006-10-23