Hi Jukka,

On Tue, Jan 11, 2011 at 12:45:33PM +0000, jukka.rissa...@nokia.com wrote:
> > g_slist_remove(ipdevice->address_list, ipaddress); 
> > 
> > -       connman_ipaddress_free(ipaddress);
> > +       connman_ipaddress_clear(ipaddress);
> > +       g_free(ipaddress);
> 
> But isn't connman_ipaddress_free() the same thing as 
> connman_ipaddress_clear()+g_free()?
> Meaning that the address was correctly cleared.
No, ipaddress_free won't set your ipaddress fields to NULL (or the prefixlen to
0).

 
> > 
> >         connman_info("%s {del} address %s/%u label %s",
> >                                                 ipdevice->ifname,
> > address, prefixlen, label); 
> > 
> > 
> >> So without the patch list-services would return
> >> 
> >> IPv6 = { PrefixLength=64 Method=off Address=2001::1 }
> > I don't know if you actually tested it, but that would be
> > de-referencing an already freed pointer. So we definitely need to do
> > something about it.  
> > 
> 
> I definitely tested the patch, valgrind does not give any de-reference 
> errors. Probably because the ipdevice->config_ipv6->system pointer is not 
> freed but it is just cleared.
>
In the current code, deladdr() will free the ipdevice->config_ipv6->system
pointer if the corresponding IP is deleted.

Cheers,
Samuel.


> 
> Jukka

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to