From 7df688e11b6030357ec7fe5512fd2f5a50d434c5 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 10 Jun 2015 16:34:39 -0500 Subject: [PATCH] wiphy: Fix memory leak ==2469== 24 bytes in 1 blocks are still reachable in loss record 1 of 1 ==2469== at 0x4C2B970: malloc (vg_replace_malloc.c:296) ==2469== by 0x40E6DD: l_malloc (util.c:62) ==2469== by 0x40F1CD: l_queue_new (queue.c:63) ==2469== by 0x40D534: scan_init (scan.c:796) ==2469== by 0x403AC3: nl80211_appeared (wiphy.c:2121) ==2469== by 0x415FF3: get_family_callback (genl.c:987) ==2469== by 0x415A4F: process_request (genl.c:381) ==2469== by 0x415A4F: received_data (genl.c:492) ==2469== by 0x413184: io_callback (io.c:120) ==2469== by 0x4127C2: l_main_run (main.c:346) ==2469== by 0x40253E: main (main.c:171) --- src/wiphy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wiphy.c b/src/wiphy.c index 7e68c82d..37ee31fe 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -2147,6 +2147,8 @@ static void nl80211_vanished(void *user_data) { l_debug("Lost nl80211 interface"); + scan_exit(); + l_queue_destroy(wiphy_list, wiphy_free); wiphy_list = NULL; } @@ -2199,6 +2201,8 @@ bool wiphy_exit(void) l_debug("Closing nl80211 interface"); + scan_exit(); + /* * The generic netlink master object keeps track of all families * and closing it will take care of freeing all associated resources.