summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/network.c4
-rw-r--r--src/provider.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/network.c b/src/network.c
index 57c8e2f8..ae58347a 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1263,11 +1263,13 @@ int connman_network_set_nameservers(struct connman_network *network,
if (nameservers != NULL)
nameservers_array = g_strsplit(nameservers, " ", 0);
- for (i = 0; nameservers_array[i] == NULL; i++) {
+ for (i = 0; nameservers_array[i] != NULL; i++) {
__connman_service_nameserver_append(service,
nameservers_array[i]);
}
+ g_strfreev(nameservers_array);
+
return 0;
}
diff --git a/src/provider.c b/src/provider.c
index 3aa35371..4061af08 100644
--- a/src/provider.c
+++ b/src/provider.c
@@ -861,11 +861,13 @@ int connman_provider_set_nameservers(struct connman_provider *provider,
if (nameservers != NULL)
nameservers_array = g_strsplit(nameservers, " ", 0);
- for (i = 0; nameservers_array[i] == NULL; i++) {
+ for (i = 0; nameservers_array[i] != NULL; i++) {
__connman_service_nameserver_append(provider->vpn_service,
nameservers_array[i]);
}
+ g_strfreev(nameservers_array);
+
return 0;
}