summaryrefslogtreecommitdiff
path: root/src/timeserver.c
diff options
context:
space:
mode:
authorAlok Barsode <alok.barsode@linux.intel.com>2012-04-05 13:20:25 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-04-05 18:57:33 +0300
commit4fdc5f62f304215559c41ca34233b0a10e9c4b2f (patch)
tree43918885d6947fb1c848f67985d5949ce2094d1f /src/timeserver.c
parent920950231d5875220010ed5810593d42b0106dc2 (diff)
downloadconnman-4fdc5f62f304215559c41ca34233b0a10e9c4b2f.tar.gz
connman-4fdc5f62f304215559c41ca34233b0a10e9c4b2f.tar.bz2
connman-4fdc5f62f304215559c41ca34233b0a10e9c4b2f.zip
timeserver: Check for resolv before accessing it
In order to cancel any ongoing resolution, check if both resolv and resolv_id are valid.
Diffstat (limited to 'src/timeserver.c')
-rw-r--r--src/timeserver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timeserver.c b/src/timeserver.c
index 65b7ad03..e8a9d159 100644
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -262,7 +262,7 @@ static int timeserver_start(struct connman_service *service)
return -EINVAL;
/* Stop an already ongoing resolution, if there is one */
- if (resolv_id > 0)
+ if (resolv != NULL && resolv_id > 0)
g_resolv_cancel_lookup(resolv, resolv_id);
/* get rid of the old resolver */