wiphy: Fix memory leak

When disconnect is triggered locally, we do not clean up properly.

==4336==    at 0x4C2B970: malloc (vg_replace_malloc.c:296)
==4336==    by 0x40CEED: l_malloc (util.c:62)
==4336==    by 0x40F46A: l_settings_new (settings.c:82)
==4336==    by 0x40CE2E: storage_network_open (storage.c:180)
==4336==    by 0x40498E: network_connect_psk (wiphy.c:307)
==4336==    by 0x40498E: network_connect (wiphy.c:359)
==4336==    by 0x41D7EE: _dbus_object_tree_dispatch (dbus-service.c:845)
==4336==    by 0x416A16: message_read_handler (dbus.c:297)
==4336==    by 0x411984: io_callback (io.c:120)
==4336==    by 0x410FC2: l_main_run (main.c:346)
==4336==    by 0x40253E: main (main.c:171)
This commit is contained in:
Denis Kenzior 2015-04-30 17:01:20 -05:00
parent 341b69ce7c
commit efe795b72d
1 changed files with 2 additions and 0 deletions

View File

@ -663,6 +663,8 @@ static void genl_disconnect_cb(struct l_genl_msg *msg, void *user_data)
return;
}
netdev_disassociated(netdev);
reply = l_dbus_message_new_method_return(netdev->disconnect_pending);
l_dbus_message_set_arguments(reply, "");
dbus_pending_reply(&netdev->disconnect_pending, reply);