service: Set network_created flag only if create_hidden_wifi succeeds
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Mon, 21 Nov 2011 08:51:42 +0000 (10:51 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 21 Nov 2011 11:00:21 +0000 (12:00 +0100)
src/service.c

index 58b921d..4ec8d9b 100644 (file)
@@ -4847,12 +4847,12 @@ int __connman_service_create_and_connect(DBusMessage *msg)
        if (service == NULL) {
                network = create_hidden_wifi(device, ssid,
                                                mode, security, group);
-               if (network != NULL)
+               if (network != NULL) {
                        connman_network_set_group(network, group);
+                       network_created = TRUE;
+               }
 
                service = lookup_by_identifier(name);
-
-               network_created = TRUE;
        }
 
        g_free(name);