diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index f690100b33..20820a425f 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -1136,7 +1136,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; @@ -1153,6 +1152,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) {