modules: hostap: Fix memory leak of network
In "connect" all networks are removed and new network is always added, but in disconnect the network isn't deleted, so, the memory is unnecessarily held till next connect. This is not exactly a leak, but if someone profiles using "kernel heap" then this can be construed as a leak. Fix this by removing network during the disconnection (for now "all") so that the memory can be used by someone else. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This commit is contained in:
parent
1174ea522f
commit
be65de0d09
|
@ -1055,6 +1055,10 @@ out:
|
||||||
wifi_mgmt_raise_disconnect_complete_event(iface, ret);
|
wifi_mgmt_raise_disconnect_complete_event(iface, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!wpa_cli_cmd_v("remove_network all")) {
|
||||||
|
wpa_printf(MSG_ERROR, "Failed to remove all networks");
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue