fix
authorChristian Grothoff <christian@grothoff.org>
Mon, 9 May 2011 09:57:52 +0000 (09:57 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 9 May 2011 09:57:52 +0000 (09:57 +0000)
src/dht/gnunet-service-dht.c

index 630c6a35bf0c9f162c093b11684a3b73750291df..ebabdfd2f4e1dddb057d662da2c0011ce089639e 100644 (file)
@@ -5579,10 +5579,22 @@ main (int argc, char *const *argv)
                              argv,
                              "dht",
                              GNUNET_SERVICE_OPTION_NONE, &run, NULL)) ? 0 : 1;
-  GNUNET_assert (0 == GNUNET_CONTAINER_multihashmap_size (recent.hashmap));
-  GNUNET_assert (0 == GNUNET_CONTAINER_heap_get_size (recent.minHeap));
-  GNUNET_CONTAINER_multihashmap_destroy (recent_find_peer_requests);
-  GNUNET_CONTAINER_multihashmap_destroy (recent.hashmap);
-  GNUNET_CONTAINER_heap_destroy (recent.minHeap);
-  return ret;
+  if (NULL != recent.hashmap)
+    {
+      GNUNET_assert (0 == GNUNET_CONTAINER_multihashmap_size (recent.hashmap));
+      GNUNET_CONTAINER_multihashmap_destroy (recent.hashmap);
+      recent.hashmap = NULL;
+    }
+  if (NULL != recent.minHeap)
+    {
+      GNUNET_assert (0 == GNUNET_CONTAINER_heap_get_size (recent.minHeap));
+      GNUNET_CONTAINER_heap_destroy (recent.minHeap); 
+      recent.minHeap = NULL;
+    }
+  if (NULL != recent_find_peer_requests)
+    {
+      GNUNET_CONTAINER_multihashmap_destroy (recent_find_peer_requests);
+      recent_find_peer_requests = NULL;
+    }
+ return ret;
 }