From 9a407ea7b33ae9146f275b670600880661237995 Mon Sep 17 00:00:00 2001 From: lurchi Date: Fri, 29 Jun 2018 00:44:23 +0200 Subject: [PATCH] fix segfault --- src/util/gnunet-service-resolver.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c index d2464846c..5b890261b 100644 --- a/src/util/gnunet-service-resolver.c +++ b/src/util/gnunet-service-resolver.c @@ -378,10 +378,19 @@ handle_resolve_result (void *cls, client); if (NULL != cache) cache->client = NULL; - GNUNET_SCHEDULER_cancel (cache->timeout_task); - GNUNET_DNSSTUB_resolve_cancel (cache->resolve_handle); - cache->timeout_task = NULL; - cache->resolve_handle = NULL; + if (NULL != cache) + { + if (NULL != cache->timeout_task) + { + GNUNET_SCHEDULER_cancel (cache->timeout_task); + cache->timeout_task = NULL; + } + if (NULL != cache->resolve_handle) + { + GNUNET_DNSSTUB_resolve_cancel (cache->resolve_handle); + cache->resolve_handle = NULL; + } + } GNUNET_DNSPARSER_free_packet (parsed); } -- 2.25.1