From: Bart Polot Date: Thu, 25 Jun 2015 03:47:36 +0000 (+0000) Subject: - don't try to retrive a peer during a shutdown task X-Git-Tag: initial-import-from-subversion-38251~1690 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=86ba6d5b16f7741768e801ea11bbdc492a1ceeb6;p=oweals%2Fgnunet.git - don't try to retrive a peer during a shutdown task --- diff --git a/src/cadet/cadet_path.c b/src/cadet/cadet_path.c index 1118f0e22..fc9f9c453 100644 --- a/src/cadet/cadet_path.c +++ b/src/cadet/cadet_path.c @@ -48,12 +48,14 @@ path_destroy_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct CadetPeer *peer; LOG (GNUNET_ERROR_TYPE_INFO, "Destroy delayed %p (%u)\n", path, path->length); - if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) - return; path->path_delete = NULL; - peer = GCP_get_short (path->peers[path->length - 1]); - if (2 < path->length) + + if (2 < path->length && (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) == 0) + { + /* During shutdown, the peers peermap might not exist anymore. */ + peer = GCP_get_short (path->peers[path->length - 1]); GCP_remove_path (peer, path); + } else path_destroy (path); }