Fix WPAD issue with empty result list
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 30 Jul 2010 21:27:46 +0000 (14:27 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 30 Jul 2010 21:27:46 +0000 (14:27 -0700)
src/wpad.c

index c76c63b..5f1f1f5 100644 (file)
@@ -65,6 +65,9 @@ static void wpad_result(GResolvResultStatus status,
        if (status == G_RESOLV_RESULT_STATUS_SUCCESS) {
                char *url;
 
+               if (results == NULL || g_strv_length(results) == 0)
+                       return;
+
                url = g_strdup_printf("http://%s/wpad.dat", wpad->hostname);
                __connman_service_set_proxy_autoconfig(wpad->service, url);
                g_free(url);