mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 15:50:26 +01:00
wifi: properly handle floating GVariant in supplicant_iface_wps_credentials_cb()
g_variant_new_parsed() returns a floating reference. Later, we pass
the floating reference to nm_settings_connection_new_secrets(),
but don't transfer ownership.
That might not be a bug (I didn't check), but it requires that
nm_settings_connection_new_secrets() does not take a reference
to the secrets variant.
Convert the floating reference to a real reference to avoid
this dangerous pattern.
Fixes: 0eb7617504
This commit is contained in:
parent
ac436dc2c4
commit
d5c857307e
1 changed files with 1 additions and 0 deletions
|
|
@ -1860,6 +1860,7 @@ supplicant_iface_wps_credentials_cb (NMSupplicantInterface *iface,
|
|||
secrets = g_variant_new_parsed ("[{%s, [{%s, <%s>}]}]",
|
||||
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
|
||||
NM_SETTING_WIRELESS_SECURITY_PSK, psk);
|
||||
g_variant_ref_sink (secrets);
|
||||
}
|
||||
}
|
||||
if (!secrets)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue