mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-26 21:40:32 +01:00
libnm/device: fix memleak options variant in nm_device_wifi_request_scan_options*()
A function that accepts a floating variant must consume it. Fixes:7691fe5753('libnm: add new functions allowing passing options to RequestScan() D-Bus call') (cherry picked from commit40911fb99b) (cherry picked from commit27301fe268)
This commit is contained in:
parent
4c704043c6
commit
07ccbdd828
1 changed files with 3 additions and 2 deletions
|
|
@ -309,6 +309,7 @@ prepare_scan_options (GVariant *options)
|
|||
g_variant_builder_add (&builder, "{sv}", key, value);
|
||||
}
|
||||
variant = g_variant_builder_end (&builder);
|
||||
nm_g_variant_unref_floating (options);
|
||||
}
|
||||
return variant;
|
||||
}
|
||||
|
|
@ -324,7 +325,7 @@ _device_wifi_request_scan (NMDeviceWifi *device,
|
|||
|
||||
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), FALSE);
|
||||
|
||||
variant = prepare_scan_options (options);
|
||||
variant = prepare_scan_options (g_steal_pointer (&options));
|
||||
|
||||
ret = nmdbus_device_wifi_call_request_scan_sync (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy,
|
||||
variant,
|
||||
|
|
@ -443,7 +444,7 @@ _device_wifi_request_scan_async (NMDeviceWifi *device,
|
|||
info->device = device;
|
||||
info->simple = simple;
|
||||
|
||||
variant = prepare_scan_options (options);
|
||||
variant = prepare_scan_options (g_steal_pointer (&options));
|
||||
|
||||
priv->scan_info = info;
|
||||
nmdbus_device_wifi_call_request_scan (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue