mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-20 19:12:33 +01:00
device: Avoid leaking memory
In case we bail out early when setting up the RSN element
This commit is contained in:
parent
e6311557fe
commit
2340c7790c
12
src/device.c
12
src/device.c
@ -649,12 +649,6 @@ void device_connect_network(struct device *device, struct network *network,
|
||||
uint8_t rsne_buf[256];
|
||||
struct ie_rsn_info info;
|
||||
|
||||
sm = eapol_sm_new();
|
||||
|
||||
eapol_sm_set_authenticator_address(sm, bss->addr);
|
||||
eapol_sm_set_supplicant_address(sm,
|
||||
netdev_get_address(device->netdev));
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
|
||||
if (security == SECURITY_PSK)
|
||||
@ -682,6 +676,12 @@ void device_connect_network(struct device *device, struct network *network,
|
||||
} else if (info.group_management_cipher != 0)
|
||||
info.mfpc = true;
|
||||
|
||||
sm = eapol_sm_new();
|
||||
|
||||
eapol_sm_set_authenticator_address(sm, bss->addr);
|
||||
eapol_sm_set_supplicant_address(sm,
|
||||
netdev_get_address(device->netdev));
|
||||
|
||||
/* RSN takes priority */
|
||||
if (bss->rsne) {
|
||||
ie_build_rsne(&info, rsne_buf);
|
||||
|
Loading…
Reference in New Issue
Block a user