fix mgmgt of heap nodes
authorChristian Grothoff <christian@grothoff.org>
Mon, 16 Apr 2018 11:24:44 +0000 (13:24 +0200)
committerChristian Grothoff <christian@grothoff.org>
Mon, 16 Apr 2018 11:24:44 +0000 (13:24 +0200)
src/namestore/gnunet-zoneimport.c

index 10d9cb4b640e8a08e8945a247dab832b8f46fa07..763687c5964c424354917ae342985f6e15a7ad05 100644 (file)
@@ -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;