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)
This commit is contained in:
Denis Kenzior 2015-06-10 16:34:39 -05:00
parent 03004bd7b6
commit 7df688e11b
1 changed files with 4 additions and 0 deletions

View File

@ -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.