about summary refs log tree commit diff
path: root/src/core/devices/wwan
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/devices/wwan')
-rw-r--r--src/core/devices/wwan/nm-modem-ofono.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/devices/wwan/nm-modem-ofono.c b/src/core/devices/wwan/nm-modem-ofono.c
index c003880e..fc27c3fd 100644
--- a/src/core/devices/wwan/nm-modem-ofono.c
+++ b/src/core/devices/wwan/nm-modem-ofono.c
@@ -739,7 +739,7 @@ handle_settings(GVariant *v_dict, gpointer user_data)
     gboolean             ret = FALSE;
     const char          *interface;
     const char          *s;
-    const char         **array;
+    gs_free const char **array = NULL;
     guint32              address_network, gateway_network;
     int                  ifindex;
     GError              *error = NULL;
@@ -838,15 +838,16 @@ handle_settings(GVariant *v_dict, gpointer user_data)
     }
     if (array) {
         gboolean any_good = FALSE;
+        gsize    i;
 
-        for (; array[0]; array++) {
-            if (!nm_utils_parse_inaddr_bin(AF_INET, *array, NULL, &address_network)
+        for (i = 0; array[i]; i++) {
+            if (!nm_utils_parse_inaddr_bin(AF_INET, array[i], NULL, &address_network)
                 || !address_network) {
-                _LOGW("invalid NameServer: %s", *array);
+                _LOGW("invalid NameServer: %s", array[i]);
                 continue;
             }
             any_good = TRUE;
-            _LOGI("DNS: %s", *array);
+            _LOGI("DNS: %s", array[i]);
             nm_l3_config_data_add_nameserver(priv->l3cd_4, AF_INET, &address_network);
         }
         if (!any_good) {