Do not call __connman_service_put() twice
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 13 Jan 2010 10:30:36 +0000 (11:30 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 13 Jan 2010 10:37:15 +0000 (02:37 -0800)
When a connection fails and service->network is not NULL, we end up calling
__connman_service_put() twice, since __connman_device_cleanup_networks()
calls it too . __connman_device_cleanup_networks() eventually calls
network_remove() from the element removal code, and that ends up calling
__connman_service_put().

src/service.c

index 1d94a66..f5bb772 100644 (file)
@@ -2013,9 +2013,8 @@ failed:
                if (network != NULL) {
                        connman_network_set_available(network, FALSE);
                        __connman_device_cleanup_networks(device);
-               }
-
-               __connman_service_put(service);
+               } else
+                       __connman_service_put(service);
        }
 
        return err;