diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-04-16 13:24:44 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-04-16 13:24:44 +0200 |
commit | b983587ce81228c1337ebd0ebd492a29c0104cd2 (patch) | |
tree | 7d8e741ce08e13068d057b540802b9f6fcff64be | |
parent | 6e69bdb7ce01dcbc9d6be5f2da4555b270a1cefe (diff) |
fix mgmgt of heap nodes
-rw-r--r-- | src/namestore/gnunet-zoneimport.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/namestore/gnunet-zoneimport.c b/src/namestore/gnunet-zoneimport.c index 10d9cb4b64..763687c596 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; |