diff options
author | Bart Polot <bart@net.in.tum.de> | 2015-10-02 03:37:32 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2015-10-02 03:37:32 +0000 |
commit | 254314af8a1168fac5fa3b6f1469372e2fc22be6 (patch) | |
tree | c65f135b055151927569e53dbee1f238029b1e21 /src/cadet | |
parent | 29bf97f91c1e4446a585bac0b92122f75f8bfde5 (diff) | |
download | gnunet-254314af8a1168fac5fa3b6f1469372e2fc22be6.tar.gz gnunet-254314af8a1168fac5fa3b6f1469372e2fc22be6.zip |
- don't leave freed memory on the peer's path list, signal error and remove anyway
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/cadet_path.c | 9 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_peer.c | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/cadet/cadet_path.c b/src/cadet/cadet_path.c index 0845f5a00..4f35b2a6c 100644 --- a/src/cadet/cadet_path.c +++ b/src/cadet/cadet_path.c | |||
@@ -51,8 +51,15 @@ path_destroy_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
51 | path->path_delete = NULL; | 51 | path->path_delete = NULL; |
52 | 52 | ||
53 | /* During shutdown, the peers peermap might not exist anymore. */ | 53 | /* During shutdown, the peers peermap might not exist anymore. */ |
54 | if (2 < path->length && (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) == 0) | 54 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) == 0) |
55 | { | 55 | { |
56 | if (2 >= path->length) | ||
57 | { | ||
58 | /* This is not the place to destroy direct paths, only core_disconnect | ||
59 | * should do it and never delay it. | ||
60 | */ | ||
61 | GNUNET_break (0); | ||
62 | } | ||
56 | peer = GCP_get_short (path->peers[path->length - 1], GNUNET_NO); | 63 | peer = GCP_get_short (path->peers[path->length - 1], GNUNET_NO); |
57 | if (NULL != peer) | 64 | if (NULL != peer) |
58 | GCP_remove_path (peer, path); | 65 | GCP_remove_path (peer, path); |
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 165553d1c..4a25b0829 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c | |||
@@ -2214,7 +2214,7 @@ GCP_add_path_to_all (const struct CadetPeerPath *p, int confirmed) | |||
2214 | 2214 | ||
2215 | 2215 | ||
2216 | /** | 2216 | /** |
2217 | * Remove any path to the peer that has the extact same peers as the one given. | 2217 | * Remove any path to the peer that has the exact same peers as the one given. |
2218 | * | 2218 | * |
2219 | * @param peer Peer to remove the path from. | 2219 | * @param peer Peer to remove the path from. |
2220 | * @param path Path to remove. Is always destroyed . | 2220 | * @param path Path to remove. Is always destroyed . |