[PATCH memleak resend 05/15] memoryleak: block was not freed

2010-12-31 Thread Jukka Rissanen
---
 plugins/supplicant.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/plugins/supplicant.c b/plugins/supplicant.c
index df181d8..6e29911 100644
--- a/plugins/supplicant.c
+++ b/plugins/supplicant.c
@@ -224,6 +224,7 @@ static void remove_block(gpointer user_data)
 
g_free(block-ssid);
g_free(block-netpath);
+   g_free(block);
 }
 
 static struct supplicant_task *find_task_by_index(int index)
-- 
1.7.0.4

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH memleak resend 06/15] memoryleak: method was not freed

2010-12-31 Thread Jukka Rissanen
---
 src/ipconfig.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/ipconfig.c b/src/ipconfig.c
index 57e3218..690b51e 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -1634,7 +1634,7 @@ void __connman_ipconfig_append_ethernet(struct 
connman_ipconfig *ipconfig,
 int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
GKeyFile *keyfile, const char *identifier, const char *prefix)
 {
-   const char *method;
+   char *method;
char *key;
 
DBG(ipconfig %p identifier %s, ipconfig, identifier);
@@ -1652,6 +1652,7 @@ int __connman_ipconfig_load(struct connman_ipconfig 
*ipconfig,
if (ipconfig-method == CONNMAN_IPCONFIG_METHOD_UNKNOWN)
ipconfig-method = CONNMAN_IPCONFIG_METHOD_OFF;
 
+   g_free(method);
g_free(key);
 
key = g_strdup_printf(%snetmask_prefixlen, prefix);
-- 
1.7.0.4

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman



[PATCH memleak resend 04/15] memoryleak: address was not freed

2010-12-31 Thread Jukka Rissanen
---
 plugins/dhcp.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/plugins/dhcp.c b/plugins/dhcp.c
index 07fed38..5fe99d7 100644
--- a/plugins/dhcp.c
+++ b/plugins/dhcp.c
@@ -76,6 +76,7 @@ static void lease_available_cb(GDHCPClient *dhcp_client, 
gpointer user_data)
address = g_dhcp_client_get_address(dhcp_client);
if (address != NULL)
connman_dhcp_set_value(dhcp, Address, address);
+   g_free(address);
 
option = g_dhcp_client_get_option(dhcp_client, G_DHCP_SUBNET);
if (option != NULL)
-- 
1.7.0.4

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH memleak resend 12/15] memoryleak: dhcp_client is already referenced when created

2010-12-31 Thread Jukka Rissanen
---
 plugins/dhcp.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/plugins/dhcp.c b/plugins/dhcp.c
index 5fe99d7..54306ed 100644
--- a/plugins/dhcp.c
+++ b/plugins/dhcp.c
@@ -191,8 +191,6 @@ static int dhcp_request(struct connman_dhcp *dhcp)
 
connman_dhcp_set_data(dhcp, dhcp_client);
 
-   g_dhcp_client_ref(dhcp_client);
-
return g_dhcp_client_start(dhcp_client);
 }
 
-- 
1.7.0.4

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH memleak resend 15/15] memoryleak: root element was not freed

2010-12-31 Thread Jukka Rissanen
---
 src/element.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/element.c b/src/element.c
index a4230b7..1dcc695 100644
--- a/src/element.c
+++ b/src/element.c
@@ -1463,6 +1463,8 @@ void __connman_element_cleanup(void)
g_node_traverse(element_root, G_POST_ORDER, G_TRAVERSE_ALL, -1,
free_node, NULL);
 
+   connman_element_unref(element_root-data);
+
g_node_destroy(element_root);
element_root = NULL;
 
-- 
1.7.0.4

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH] [Memleak] Free the IO channel if connection to the DNS server fails

2010-12-31 Thread leena.gunda
From: Leena Gunda leena.gu...@wipro.com

Fixes BMC#11878

---
 plugins/dnsproxy.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/plugins/dnsproxy.c b/plugins/dnsproxy.c
index 5ce6429..60b7a39 100644
--- a/plugins/dnsproxy.c
+++ b/plugins/dnsproxy.c
@@ -769,11 +769,14 @@ static struct server_data *create_server(const char 
*interface,
GList *list;
 
connman_error(Failed to connect to server %s, server);
-   close(sk);
if (data-watch  0)
g_source_remove(data-watch);
if (data-timeout  0)
g_source_remove(data-timeout);
+
+   g_io_channel_unref(data-channel);
+   close(sk);
+
g_free(data-server);
g_free(data-interface);
for (list = data-domains; list; list = list-next) {
-- 
1.7.2.2
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH] [Memleak] Free the IO channel if connection to the DNS server fails

2010-12-31 Thread Marcel Holtmann
Hi Leena,

 From: Leena Gunda leena.gu...@wipro.com
 
 Fixes BMC#11878
 
 ---
  plugins/dnsproxy.c |5 -
  1 files changed, 4 insertions(+), 1 deletions(-)

patch has been applied. Thanks.

Regards

Marcel


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH memleak resend 00/15] Memory leak fixes

2010-12-31 Thread Marcel Holtmann
Hi Jukka,

 Here are the memory leak patches that I sent before christmas.
 There are still issues with supplicant.c but as it is being
 deprecated I have not really looked the memory leaks in it.

so I applied all of the patches except one. Thanks for re-sending the
whole patchset.

Regards

Marcel


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Client or Connman Error When Dealing with Special SSIDs

2010-12-31 Thread Grant Erickson
On 12/31/10 11:17 AM, Grant Erickson wrote:
 On 12/31/10 9:21 AM, Grant Erickson wrote:
 On 12/31/10 8:05 AM, Grant Erickson wrote:
 On 12/30/10 12:25 PM, Marcel Holtmann wrote:
 I recently came across a use case in which connmand-0.64 generates two
 conflicting network service entries for a wireless access point with an
 SSID
 from the special list that ultimately results in not being able to
 connect
 to the SSID at all.

 So it seems there is a bug somewhere that leads to creating these twice
 and then confuse the system. This needs to be fixed, but I don't see
 that one right now.
 
 As I debug this further, in two debugging trials running connman in the
 foreground with '-d' asserted, I found two blocks in the logs for each trial
 that might be informative.
 
 It appears that the code path for hidden networks gets triggered from
 connect_service(), even though this linksys SSID / BSSID is not a hidden
 network and is clearly broadcasting its SSID.
 
 As far as I can see, the root cause of the problem seems to be the two
 independent and slightly different group creation routines. The first:
 
 connman-0.64/plugins/supplicant.c:static char *build_group(...);
 
 which has the handling for special SSIDs and the second:
 
 connman-0.64/src/wifi.c:char *connman_wifi_build_group_name(...);
 
 which lacks this special handling. I'll look at unifying these.

Looking at the code further, it appears that there are two D-Bus interface
entry points for connecting to services: the manager interface and the
service interface.

At present, the user interface in question for this bug uses the manager
interface which then funnels into manager.c:connect_service() which then
funnels into service.c:__connman_service_create_and_connect().

Unfortunately, in __connman_service_create_and_connect() there does not
appear to exist enough information to correctly call a theoretically-unified
connman_wifi_create_group_name() which would need the network identifier and
name and which are also not yet retrievable given the available information
when __connman_service_create_and_connect is called.

The other alternative might be to get the service path from the D-Bus
message; however, that appears to be /, which is of no utility for looking
up the service.

Which is the preferred/correct interface for requesting service connections,
service or manager?

Regards,

Grant


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman