device: Free eapol_sm on netdev_connect failure

This commit is contained in:
Denis Kenzior 2016-09-14 09:50:08 -05:00
parent 09dcd78e30
commit 959ebd505b
1 changed files with 3 additions and 0 deletions

View File

@ -662,6 +662,9 @@ void device_connect_network(struct device *device, struct network *network,
if (netdev_connect(device->netdev, bss, sm,
device_netdev_event,
device_connect_cb, device) < 0) {
if (sm)
eapol_sm_free(sm);
dbus_pending_reply(&device->connect_pending,
dbus_error_failed(device->connect_pending));
return;