[ldns-users] ldns_resolver_pop_nameserver and ldns_resolver_deep_free

Marius Rieder marius.rieder at durchmesser.ch
Thu Jul 26 07:58:57 UTC 2012


Hi,

If i remove all nameserver with ldns_resolver_pop_nameserver and
do a ldns_resolver_deep_free later. Ldns double frees the
r->_nameservers and r->_rtt.

ldns_resolver_pop_nameserver reallocs [1]boath with size 0, which is a
equivalent to free. Which is perfect fine, but do not update the pointer
in the ldns_resolver.

[1]http://www.nlnetlabs.nl/projects/ldns/doc/resolver_8c_source.html#l00256

As realloc could return NULL in case of a failed realloc aswell, it may
be nessesary to check the ns_count eigther in
ldns_resolver_pop_nameserver or ldns_resolver_deep_free.

 - Marius

-- 
   ~o__O                 Marius Rieder                  O__o~
    |vV|           http://www.durchmesser.ch/           |vV|
   /]  |         <marius.rieder at durchmesser.ch>         |  [\
---/|--|\--------[ Dance first.  Think later. ]--------/|--|\---



More information about the ldns-users mailing list