From c13cef1b58b347d733bdf4739523cb5b05409b10 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 9 Sep 2020 08:32:44 +0200 Subject: [PATCH] libnm: fix memleak in nm_device_wifi_request_scan_options_async() for floating options argument Fixes: 7691fe575377 ('libnm: add new functions allowing passing options to RequestScan() D-Bus call') (cherry picked from commit 187003882e31180be9420204d37c0045be9c61c9) --- libnm/nm-device-wifi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c index 1bdefeba17..29366e5681 100644 --- a/libnm/nm-device-wifi.c +++ b/libnm/nm-device-wifi.c @@ -415,10 +415,10 @@ request_scan_cb (GObject *source, static void _device_wifi_request_scan_async (NMDeviceWifi *device, - GVariant *options, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) + GVariant *options, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device); RequestScanInfo *info; @@ -437,6 +437,8 @@ _device_wifi_request_scan_async (NMDeviceWifi *device, g_simple_async_result_set_op_res_gboolean (simple, TRUE); g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); + if (options) + nm_g_variant_unref_floating (options); return; }