LDB hidden memory leaks

Andrew Bartlett abartlet at samba.org
Mon Jul 12 18:17:45 MDT 2010

On Tue, 2010-07-13 at 02:43 +0300, Kamen Mazdrashki wrote:
> On Tue, Jul 13, 2010 at 01:10, simo <idra at samba.org> wrote:

>         Even if it were I would not be thrilled by such a change.
>         Why you pass an argument is clear as soon as you look at the
>         function
>         definition of the function you are calling.
> This is exactly what I want to avoid, right :)
> Forcing TALLOC_CTX* explicit cast may be implemented 
> with compile time warnings - we just need to re-typedef TALLOC_CTX.
> Look what a patch I got this way:
> http://gitweb.samba.org/?p=kamenim/samba.git;a=commitdiff;h=6a3aaa1197950d16bb623c26f910347bb1fceb83

I don't see how that patch would change anything in terms of the
warnings, but in terms of self-documenting code, this is a change that
should be applied.  The void * here comes from an earlier time in ldb
when it did not always have to use talloc().  This particular oddity was
done away with a long time ago. 

Anyway, your patch is good, the TALLOC_CTX * is still a void *, but at
least now the programmer has a better clue as to what it is used for.

However, we can't change TALLOC_CTX * from void * without breaking the
taloc API. 

Andrew Bartlett

Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100713/98b817fc/attachment.pgp>

More information about the samba-technical mailing list