[ldns-users] Issue with ldns_resolver_deep_free and TSIG

W.C.A. Wijngaards wouter at NLnetLabs.nl
Fri Apr 16 12:48:17 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Michael,

Yes this is wrong.  I guess the least-surprising solution is to copy the
strings and delete them, for all three values.

Best regards,
   Wouter


On 04/15/2010 07:01 PM, Michael Sheldon wrote:
> When assigning TSIG parameters to ldns_resolver using
> ldns_resolver_tsig_keyname, ldns_resolver_tsig_algorithm and
> ldns_resolver_tsig_keydata, those functions merely set the pointer to
> the pointer value passed, they do not actually copy the data. However,
> when ldns_resolver_deep_free is called, it attempts to free
> res->_tsig_keyname.
> 
> First, ldns_resolver_deep_free probably should not attempt to free
> these, unless the set functions are modified to make copies instead of
> just storing the pointer.
> 
> Second, and possibly more significant, ldns_resolver_deep_free is
> inconsistent in that it only attempts to free one of the three values,
> but not the others. For someone who *does* expect the values to be
> freed, this would result in a memory leak.
> 
> Michael Sheldon
> 
> 
> 
> _______________________________________________
> ldns-users mailing list
> ldns-users at open.nlnetlabs.nl
> http://open.nlnetlabs.nl/mailman/listinfo/ldns-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkvIXJEACgkQkDLqNwOhpPi6RQCfSMYr9kS8Gkwr9XX04YVKh2Wy
BvQAn0tLknzXNsy43oihyLs69/Gd1mGx
=wdWJ
-----END PGP SIGNATURE-----



More information about the ldns-users mailing list