summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorLeena Gunda <leena.gunda@wipro.com>2011-01-06 11:57:33 +0530
committerMarcel Holtmann <marcel@holtmann.org>2011-01-05 23:33:00 -0800
commit61db9ca5770de39c35b29a3bcb6e18f6ea921ba7 (patch)
treebfbbe45e20e810201f3850aa2b54ef5b65c8b323 /gsupplicant
parentb35c5c84316d50a04c23ae09885390a71ff58f8d (diff)
downloadconnman-61db9ca5770de39c35b29a3bcb6e18f6ea921ba7.tar.gz
connman-61db9ca5770de39c35b29a3bcb6e18f6ea921ba7.tar.bz2
connman-61db9ca5770de39c35b29a3bcb6e18f6ea921ba7.zip
Fix memory leaks in gsupplicant interface_property
Free the interface properties before doing a g_strdup. Fixes BMC#11687
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/supplicant.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 6302af01..95e5efc5 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) {