From: Bart Polot Date: Mon, 18 Nov 2013 14:34:11 +0000 (+0000) Subject: - fix use after free on shutdown (#3112) X-Git-Tag: initial-import-from-subversion-38251~6038 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cf31c1bc656e1747c2e3deea8ef851743b9e09c5;p=oweals%2Fgnunet.git - fix use after free on shutdown (#3112) --- 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);