When calling unregister_network() ConnMan sets the network->device pointer
to NULL. That is fine with ESSIDs formed by 1 AP. Otherwise, the eventual
call to __connman_device_decrease_connections() leads to a crash as the
device pointer is NULL.
Fixes BMC #6772
void __connman_device_increase_connections(struct connman_device *device)
{
+ if (device == NULL)
+ return;
+
device->connections++;
}
void __connman_device_decrease_connections(struct connman_device *device)
{
+ if (device == NULL)
+ return;
+
device->connections--;
}