From cf31c1bc656e1747c2e3deea8ef851743b9e09c5 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 18 Nov 2013 14:34:11 +0000 Subject: [PATCH] - fix use after free on shutdown (#3112) --- src/mesh/gnunet-service-mesh_connection.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index a7af5eb60..d8d492826 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c @@ -2077,6 +2077,7 @@ void GMC_shutdown (void) { GNUNET_CONTAINER_multihashmap_destroy (connections); + connections = NULL; } @@ -2145,6 +2146,10 @@ GMC_destroy (struct MeshConnection *c) GNUNET_SCHEDULER_cancel (c->fwd_maintenance_task); if (GNUNET_SCHEDULER_NO_TASK != c->bck_maintenance_task) GNUNET_SCHEDULER_cancel (c->bck_maintenance_task); + if (GNUNET_SCHEDULER_NO_TASK != c->fwd_fc.poll_task) + GNUNET_SCHEDULER_cancel (c->fwd_fc.poll_task); + if (GNUNET_SCHEDULER_NO_TASK != c->bck_fc.poll_task) + GNUNET_SCHEDULER_cancel (c->bck_fc.poll_task); /* Unregister from neighbors */ unregister_neighbors (c); -- 2.25.1