From: Christian Grothoff Date: Mon, 16 Apr 2018 11:24:44 +0000 (+0200) Subject: fix mgmgt of heap nodes X-Git-Tag: v0.11.0pre66~101 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b983587ce81228c1337ebd0ebd492a29c0104cd2;p=oweals%2Fgnunet.git fix mgmgt of heap nodes --- 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;