summaryrefslogtreecommitdiff
path: root/src/wpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wpad.c')
-rw-r--r--src/wpad.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wpad.c b/src/wpad.c
index dd25c7c6..e6d77e7d 100644
--- a/src/wpad.c
+++ b/src/wpad.c
@@ -147,12 +147,15 @@ int __connman_wpad_start(struct connman_service *service)
return -EINVAL;
wpad = g_try_new0(struct connman_wpad, 1);
- if (wpad == NULL)
+ if (wpad == NULL) {
+ g_strfreev(nameservers);
return -ENOMEM;
+ }
wpad->service = service;
wpad->resolv = g_resolv_new(index);
if (wpad->resolv == NULL) {
+ g_strfreev(nameservers);
g_free(wpad);
return -ENOMEM;
}
@@ -163,6 +166,8 @@ int __connman_wpad_start(struct connman_service *service)
for (i = 0; nameservers[i] != NULL; i++)
g_resolv_add_nameserver(wpad->resolv, nameservers[i], 53, 0);
+ g_strfreev(nameservers);
+
wpad->hostname = g_strdup_printf("wpad.%s", domainname);
DBG("hostname %s", wpad->hostname);