From 5adda020824f33ee1c5f27f3709c7311a6c3bcf1 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 29 Aug 2012 14:25:42 +0000 Subject: [PATCH] - fix crash on disconnect --- src/mesh/gnunet-service-mesh.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index fa392901c..77a7208e6 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -4055,6 +4055,13 @@ tunnel_cancel_queues (void *cls, GNUNET_PEER_Id neighbor_id) next = pq->next; if (pq->tunnel == t) { + if (GNUNET_MESSAGE_TYPE_MESH_MULTICAST == pq->type || + GNUNET_MESSAGE_TYPE_MESH_UNICAST == pq->type || + GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN == pq->type) + { + // Should have been removed on destroy children + GNUNET_break (0); + } queue_destroy (pq, GNUNET_YES); } } @@ -4083,8 +4090,6 @@ tunnel_destroy (struct MeshTunnel *t) if (NULL == t) return GNUNET_OK; - tree_iterate_children (t->tree, &tunnel_cancel_queues, t); - r = GNUNET_OK; c = t->owner; #if MESH_DEBUG @@ -4152,6 +4157,8 @@ tunnel_destroy (struct MeshTunnel *t) t); GNUNET_CONTAINER_multihashmap_destroy (t->children_fc); + tree_iterate_children (t->tree, &tunnel_cancel_queues, t); + tree_destroy (t->tree); if (NULL != t->regex_ctx) -- 2.25.1