mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
iwd: Fix a use after free
In connection_removed we use the id.name that was being g_freed a few
lines further down.
Fixes: bea6c40367
('wifi/iwd: handle forgetting connection profiles')
This commit is contained in:
parent
ab3f18b906
commit
c1ff06e119
|
@ -692,15 +692,16 @@ connection_removed(NMSettings *settings, NMSettingsConnection *sett_conn, gpoint
|
|||
gboolean mapped;
|
||||
KnownNetworkData * data;
|
||||
KnownNetworkId id;
|
||||
gs_free char * ssid_str = NULL;
|
||||
|
||||
id.security = nm_wifi_connection_get_iwd_security(conn, &mapped);
|
||||
if (!mapped)
|
||||
return;
|
||||
|
||||
s_wireless = nm_connection_get_setting_wireless(conn);
|
||||
id.name = _nm_utils_ssid_to_utf8(nm_setting_wireless_get_ssid(s_wireless));
|
||||
ssid_str = _nm_utils_ssid_to_utf8(nm_setting_wireless_get_ssid(s_wireless));
|
||||
id.name = ssid_str;
|
||||
data = g_hash_table_lookup(priv->known_networks, &id);
|
||||
g_free((char *) id.name);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue