aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_path.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/cadet_path.c')
-rw-r--r--src/cadet/cadet_path.c10
1 files changed, 6 insertions, 4 deletions
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)
48 struct CadetPeer *peer; 48 struct CadetPeer *peer;
49 49
50 LOG (GNUNET_ERROR_TYPE_INFO, "Destroy delayed %p (%u)\n", path, path->length); 50 LOG (GNUNET_ERROR_TYPE_INFO, "Destroy delayed %p (%u)\n", path, path->length);
51 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
52 return;
53 path->path_delete = NULL; 51 path->path_delete = NULL;
54 peer = GCP_get_short (path->peers[path->length - 1]); 52
55 if (2 < path->length) 53 if (2 < path->length && (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) == 0)
54 {
55 /* During shutdown, the peers peermap might not exist anymore. */
56 peer = GCP_get_short (path->peers[path->length - 1]);
56 GCP_remove_path (peer, path); 57 GCP_remove_path (peer, path);
58 }
57 else 59 else
58 path_destroy (path); 60 path_destroy (path);
59} 61}