Below is a patch for:
http://bugs.meego.com/show_bug.cgi?id=11687
Free the properties if already allocated before doing a g_strdup.
---
gsupplicant/supplicant.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 8d2c15f..2d9756d 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1270,20 +1270,32 @@ 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) {
+ if (interface->ifname != 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) {
+ if (interface->driver != 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) {
+ if (interface->bridge != 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
[email protected]
http://lists.connman.net/listinfo/connman