summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-01-04 11:44:47 +0100
committerThomas Haller <thaller@redhat.com>2020-01-08 10:29:04 +0100
commit5ed1edc02a064d48017b56bfa929ec4c08795a10 (patch)
tree60fb8e7e35739fd5675f5e791b1fa9f2fce5d565
parent6da9e06508b1ee25411993c910d6bc418e18df7f (diff)
downloadNetworkManager-5ed1edc02a064d48017b56bfa929ec4c08795a10.tar.gz
device/wifi: fix memleak parsing SSID arguments for "RequestScan"
Oddly enough, valgrind was not complaining about this leak... Fixes: 87b2d783b6c7 ('core: accept 'ssids':aay option in RequestScan() dictionary parameter')
-rw-r--r--src/devices/wifi/nm-device-wifi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index 75b9943c80..260a4ca06b 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -1075,7 +1075,6 @@ static GPtrArray *
ssids_options_to_ptrarray (GVariant *value, GError **error)
{
GPtrArray *ssids = NULL;
- GVariant *v;
const guint8 *bytes;
gsize len;
int num_ssids, i;
@@ -1092,6 +1091,8 @@ ssids_options_to_ptrarray (GVariant *value, GError **error)
if (num_ssids) {
ssids = g_ptr_array_new_full (num_ssids, (GDestroyNotify) g_bytes_unref);
for (i = 0; i < num_ssids; i++) {
+ gs_unref_variant GVariant *v = NULL;
+
v = g_variant_get_child_value (value, i);
bytes = g_variant_get_fixed_array (v, &len, sizeof (guint8));
if (len > 32) {