summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorSaurav Babu <saurav.babu@samsung.com>2018-05-24 12:01:54 +0530
committerSaurav Babu <saurav.babu@samsung.com>2018-05-24 15:38:33 +0530
commitea06d6f89f3860358c26de964e935c51718489b4 (patch)
tree73063cd0eee59956ae9f31528f59a28dd04ba936 /gsupplicant
parent146f8947c8f8e7c16802d8a653ab0e01e09b4a01 (diff)
downloadconnman-ea06d6f89f3860358c26de964e935c51718489b4.tar.gz
connman-ea06d6f89f3860358c26de964e935c51718489b4.tar.bz2
connman-ea06d6f89f3860358c26de964e935c51718489b4.zip
Fixed various memory leaks
Below are few of the valgrind outputs: ==2694== 7,484 (576 direct, 6,908 indirect) bytes in 72 blocks are definitely lost in loss record 196 of 197 ==2694== at 0x48458A4: malloc (vg_replace_malloc.c:299) ==2694== by 0x48C11B3: g_malloc (gmem.c:94) ==2694== by 0x48DA4A3: g_slice_alloc (gslice.c:1025) ==2694== by 0x48DBA13: g_slist_append (gslist.c:213) ==2694== by 0x12EF29: g_supplicant_network_get_wifi_vsie(supplicant.c:1605) ==2694== by 0x127097: network_added (wifi.c:3447) ==2694== by 0x12A41D: callback_network_added (supplicant.c:624) ==2694== by 0x12A41D: add_or_replace_bss_to_network(supplicant.c:1967) ==2694== by 0x12B9C9: interface_bss_added_with_keys(supplicant.c:2457) ==2694== by 0x12B9C9: signal_bss_added (supplicant.c:3106) ==2694== by 0x12AF1D: g_supplicant_filter (supplicant.c:4045) ==2694== by 0x49904EB: dbus_connection_dispatch (in/usr/lib/libdbus-1.so.3.14.6) ==2694== by 0x18E921: message_dispatch (mainloop.c:76) ==2694== by 0x48BB8E7: g_main_dispatch (gmain.c:3234) ==2694== by 0x48BB8E7: g_main_context_dispatch (gmain.c:3887) ==2694== 1,980 (304 direct, 1,676 indirect) bytes in 38 blocks are definitely lost in loss record 187 of 197 ==2694== at 0x48458A4: malloc (vg_replace_malloc.c:299) ==2694== by 0x48C11B3: g_malloc (gmem.c:94) ==2694== by 0x48DA4A3: g_slice_alloc (gslice.c:1025) ==2694== by 0x48DBA13: g_slist_append (gslist.c:213) ==2694== by 0x128D3F: update_bssid_list (supplicant.c:1637) ==2694== by 0x48A989F: g_hash_table_foreach (ghash.c:1610) ==2694== by 0x12EF91: g_supplicant_network_get_bssid_list(supplicant.c:1649) ==2694== by 0x127177: network_added (wifi.c:3489) ==2694== by 0x1294D5: callback_network_added (supplicant.c:624) ==2694== by 0x1294D5: scan_network_update (supplicant.c:2810) ==2694== by 0x130151: supplicant_dbus_array_foreach (dbus.c:106) ==2694== by 0x1298E3: scan_bss_data (supplicant.c:2824) ==2694== by 0x130071: property_get_reply (dbus.c:273) ==2694== 28 bytes in 2 blocks are definitely lost in loss record 87 of 197 ==2694== at 0x48458A4: malloc (vg_replace_malloc.c:299) ==2694== by 0x48C11B3: g_malloc (gmem.c:94) ==2694== by 0x48DBF03: g_strdup (gstrfuncs.c:363) ==2694== by 0x12A65B: merge_network (supplicant.c:1737) ==2694== by 0x12A7D9: network_property (supplicant.c:1758) ==2694== by 0x12A7D9: interface_network_added (supplicant.c:1808) ==2694== by 0x12AF1D: g_supplicant_filter (supplicant.c:4045) ==2694== by 0x49904EB: dbus_connection_dispatch (in /usr/lib/libdbus-1.so.3.14.6) ==2694== by 0x18E921: message_dispatch (mainloop.c:76) ==2694== by 0x48BB8E7: g_main_dispatch (gmain.c:3234) ==2694== by 0x48BB8E7: g_main_context_dispatch (gmain.c:3887) ==2694== by 0x48BBC77: g_main_context_iterate.isra.30 (gmain.c:3960) ==2694== by 0x48BBFD7: g_main_loop_run (gmain.c:4156) ==2694== by 0x119391: main (main.c:851) Change-Id: I3d86724c44b1593e5444a65eb7519bc150e50ee5 Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/supplicant.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 49d391fe..5fedf023 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1657,7 +1657,6 @@ static void merge_network(GSupplicantNetwork *network)
GString *str;
const char *ssid, *mode, *key_mgmt;
#if defined TIZEN_EXT
- GSupplicantInterface *interface;
const char *isHS20AP;
const char *eap, *identity, *phase2;
#endif
@@ -1672,7 +1671,6 @@ static void merge_network(GSupplicantNetwork *network)
eap = g_hash_table_lookup(network->config_table, "eap");
identity = g_hash_table_lookup(network->config_table, "identity");
phase2 = g_hash_table_lookup(network->config_table, "phase2");
- interface = network->interface;
#endif
SUPPLICANT_DBG("ssid %s mode %s", ssid, mode);
@@ -1731,11 +1729,9 @@ static void merge_network(GSupplicantNetwork *network)
} else
network->isHS20AP = 0;
- if (interface)
- interface->network_path = g_strdup(network->path);
-
network->group = g_strdup(group);
callback_network_merged(network);
+ g_free(network->group);
#endif
g_free(group);
@@ -4918,6 +4914,10 @@ static void interface_add_network_result(const char *error,
SUPPLICANT_DBG("PATH: %s", path);
+#if defined TIZEN_EXT
+ if (interface->network_path)
+ g_free(interface->network_path);
+#endif
interface->network_path = g_strdup(path);
store_network_information(interface, data->ssid);