When connect to a 3G service with weak signal, it may connect
several times. When connman suspend to S3 and resume several
times, function remove_timeout only remove the last timeout event.
This will lead connman crash when connect_timeout invoked by other
timeout event to access previous already freed service.
return 0;
if (err == -EINPROGRESS) {
- service->timeout = g_timeout_add_seconds(CONNECT_TIMEOUT,
- connect_timeout, service);
+ if (service->timeout == 0)
+ service->timeout = g_timeout_add_seconds(
+ CONNECT_TIMEOUT, connect_timeout, service);
return -EINPROGRESS;
}