diff options
author | Jose Blanquicet <blanquicet@gmail.com> | 2016-09-15 12:07:00 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2016-09-16 11:09:45 +0300 |
commit | 51ed8c0fa6a3f21f0a5bb7b7633aa8694d45d3ef (patch) | |
tree | 500bcc47b1bd3acb1fdf2d11bb624e44edbf43b3 /gsupplicant | |
parent | a07c991519186f5a9f34212c7ce7920c354a77a1 (diff) | |
download | connman-51ed8c0fa6a3f21f0a5bb7b7633aa8694d45d3ef.tar.gz |
gsupplicant: Fix memory leak
Memory allocated to store Wi-Fi Display information needs to be freed.
The number of lost blocks is proportional to the number of found peers.
The following valgrind report was got when there were two peers in range:
==10427== 18 bytes in 2 blocks are definitely lost in loss record 48 of 181
==10427== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10427== by 0x4E85668: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==10427== by 0x423C7C: peer_property (supplicant.c:2926)
==10427== by 0x42983C: supplicant_dbus_property_foreach (dbus.c:145)
==10427== by 0x429951: property_get_all_reply (dbus.c:184)
==10427== by 0x514A501: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.7.6)
==10427== by 0x514D730: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.7.6)
==10427== by 0x483C8F: message_dispatch (mainloop.c:72)
==10427== by 0x4E7FCE4: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==10427== by 0x4E80047: g_main_context_iterate.isra.24 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==10427== by 0x4E80309: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==10427== by 0x41001C: main (main.c:706)
Diffstat (limited to 'gsupplicant')
-rw-r--r-- | gsupplicant/supplicant.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 0a3815de..72000419 100644 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -764,6 +764,7 @@ static void remove_peer(gpointer data) g_free(peer->path); g_free(peer->name); g_free(peer->identifier); + g_free(peer->widi_ies); g_free(peer); } |