From 804b21e74e25b3d42719688ba809ef7f04c80803 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 22 Sep 2016 11:49:55 +0000 Subject: [PATCH] -fix use after free --- src/cadet/gnunet-service-cadet_peer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 5ccd8f014..9fa25a1fa 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c @@ -1281,11 +1281,6 @@ GCP_shutdown (void) GNUNET_CORE_disconnecT (core_handle); core_handle = NULL; } - if (NULL != ats_ch) - { - GNUNET_ATS_connectivity_done (ats_ch); - ats_ch = NULL; - } GNUNET_PEER_change_rc (myid, -1); /* With MQ API, CORE calls the disconnect handler for every peer * after calling GNUNET_CORE_disconnecT, shutdown must occur *after* that. @@ -1293,6 +1288,11 @@ GCP_shutdown (void) GNUNET_CONTAINER_multipeermap_iterate (peers, &shutdown_peer, NULL); + if (NULL != ats_ch) + { + GNUNET_ATS_connectivity_done (ats_ch); + ats_ch = NULL; + } GNUNET_CONTAINER_multipeermap_destroy (peers); peers = NULL; } -- 2.25.1