Hi Marcel,

>-----Original Message-----
>From: [email protected]
>[mailto:[email protected]] On Behalf Of Marcel Holtmann
>Sent: Friday, July 29, 2011 6:05 PM
>To: [email protected]
>Subject: Re: [PATCH] ofono: Duplicates path value instead use it directly
>
>Hi Arron,
>
>> Path value will be freed after the function call, this may lead to
>> can't connect/reconnect to a 3G service
>> ---
>>  plugins/ofono.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/plugins/ofono.c b/plugins/ofono.c
>> index 8650bfc..37fb345 100644
>> --- a/plugins/ofono.c
>> +++ b/plugins/ofono.c
>> @@ -882,7 +882,7 @@ static int add_network(struct connman_device
>*device,
>>
>>      create_service(network);
>>
>> -    g_hash_table_insert(network_hash, (char *) path, info);
>> +    g_hash_table_insert(network_hash, g_strdup(path), info);
>>
>>      connman_network_set_available(network, TRUE);
>>      connman_network_set_index(network, -1);
>
>and now you have a memory leak since you never free that allocated
>memory.
>
>        network_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
>                                                NULL,
>remove_network);

Thanks, I'll fix it and resubmit.

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to