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().
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;