Hi Daniel,

> >>  src/network.c |    1 -
> >>  1 files changed, 0 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/src/network.c b/src/network.c
> >> index 220164a..be72b05 100644
> >> --- a/src/network.c
> >> +++ b/src/network.c
> >> @@ -331,7 +331,6 @@ static void network_destruct(struct connman_network 
> >> *network)
> >>    g_free(network->node);
> >>    g_free(network->name);
> >>    g_free(network->identifier);
> >> -  g_free(network->path);
> >>  
> >>    network->device = NULL;
> > 
> > I do not like this one. Please use g_hash_table_replace and give not a
> > destroy function for the keys.
> 
> We use a string in connman_network_create() as identifier and then we
> store the network object into a list. To lookup the network we just
> using the identifier. The path string is currently nothing special. It's
> just like any other string property (e.g. SSID).
> 
> Do you propose to use the path as identifier and using a hash table for
> storing it?

if it is network->path, then it should be freed in the network_destruct
function and not somewhere else.

And I just went through the code and saw my mistake:

        g_free(network->path);
        g_free(network->group);
        g_free(network->node);
        g_free(network->name);
        g_free(network->identifier);
        g_free(network->path);

Seems it was too late yesterday. Yes, you are 100% right. We have a damn
double free here. Plain and simpler. I was just too stupid to see it :(

Patch has been applied. Thanks.

Regards

Marcel


_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to