From b983587ce81228c1337ebd0ebd492a29c0104cd2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 16 Apr 2018 13:24:44 +0200 Subject: [PATCH] fix mgmgt of heap nodes --- src/namestore/gnunet-zoneimport.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/namestore/gnunet-zoneimport.c b/src/namestore/gnunet-zoneimport.c index 10d9cb4b6..763687c59 100644 --- a/src/namestore/gnunet-zoneimport.c +++ b/src/namestore/gnunet-zoneimport.c @@ -752,8 +752,12 @@ process_result (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stub gave up on DNS reply for `%s'\n", req->hostname); - GNUNET_assert (req == GNUNET_CONTAINER_heap_remove_node (req->hn)); - req->hn = NULL; + if (NULL != req->hn) + { + GNUNET_break (0); /* should not be possible */ + GNUNET_assert (req == GNUNET_CONTAINER_heap_remove_node (req->hn)); + req->hn = NULL; + } if (req->issue_num > MAX_RETRIES) { failures++; @@ -771,8 +775,12 @@ process_result (void *cls, pending--; GNUNET_DNSSTUB_resolve_cancel (req->rs); req->rs = NULL; - GNUNET_assert (req == GNUNET_CONTAINER_heap_remove_node (req->hn)); - req->hn = NULL; + if (NULL != req->hn) + { + GNUNET_break (0); /* should not be possible */ + GNUNET_assert (req == GNUNET_CONTAINER_heap_remove_node (req->hn)); + req->hn = NULL; + } p = GNUNET_DNSPARSER_parse ((const char *) dns, dns_len); if (NULL == p) @@ -932,7 +940,7 @@ finish_transaction () * @param cls NULL */ static void -process_queue(void *cls) +process_queue (void *cls) { struct Request *req; static unsigned int cnt; -- 2.25.1