[PATCH resend v1] Fix memory leaks in gsupplicant interface_property

2011-01-05 Thread leena.gunda
From: Leena Gunda leena.gu...@wipro.com

Free the interface properties before doing a g_strdup.
Fixes BMC#11687

---
 gsupplicant/supplicant.c |   12 +---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 8452656..eae2bef 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1272,20 +1272,26 @@ static void interface_property(const char *key, 
DBusMessageIter *iter,
const char *str = NULL;
 
dbus_message_iter_get_basic(iter, str);
-   if (str != NULL)
+   if (str != NULL) {
+   g_free(interface-ifname);
interface-ifname = g_strdup(str);
+   }
} else if (g_strcmp0(key, Driver) == 0) {
const char *str = NULL;
 
dbus_message_iter_get_basic(iter, str);
-   if (str != NULL)
+   if (str != NULL) {
+   g_free(interface-driver);
interface-driver = g_strdup(str);
+   }
} else if (g_strcmp0(key, BridgeIfname) == 0) {
const char *str = NULL;
 
dbus_message_iter_get_basic(iter, str);
-   if (str != NULL)
+   if (str != NULL) {
+   g_free(interface-bridge);
interface-bridge = g_strdup(str);
+   }
} else if (g_strcmp0(key, CurrentBSS) == 0) {
interface_bss_added(iter, interface);
} else if (g_strcmp0(key, CurrentNetwork) == 0) {
-- 
1.7.2.2
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH resend v1] Fix memory leaks in gsupplicant interface_property

2011-01-05 Thread Marcel Holtmann
Hi Leena,

 Free the interface properties before doing a g_strdup.
 Fixes BMC#11687
 
 ---
  gsupplicant/supplicant.c |   12 +---
  1 files changed, 9 insertions(+), 3 deletions(-)

patch has been applied. Thanks.

Regards

Marcel


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