From: Alok Barsode <[email protected]>

In order to cancel any ongoing resolution, check
if both resolv and resolv_id are valid.
---
 src/timeserver.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/timeserver.c b/src/timeserver.c
index 434131c..3ed4316 100644
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -254,7 +254,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 */
-- 
1.7.5.4

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to