summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-05-09 09:57:52 +0000
committerChristian Grothoff <christian@grothoff.org>2011-05-09 09:57:52 +0000
commit1644d06c73c9fe34b665277856e5bf9fff84ccb0 (patch)
treee508626ee953ddd1ff39dd9f6e1e4e85331f7551 /src
parent9d842264f53b40a539466bb2a5df4ad75601a85e (diff)
fix
Diffstat (limited to 'src')
-rw-r--r--src/dht/gnunet-service-dht.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c
index 630c6a35b..ebabdfd2f 100644
--- a/src/dht/gnunet-service-dht.c
+++ b/src/dht/gnunet-service-dht.c
@@ -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;
}