summaryrefslogtreecommitdiff
path: root/src/rps/gnunet-service-rps.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rps/gnunet-service-rps.c')
-rw-r--r--src/rps/gnunet-service-rps.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index dc4c5dab7..cccd1a4b3 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2637,7 +2637,7 @@ insert_in_sampler (void *cls,
}
#ifdef TO_FILE
sub->num_observed_peers++;
- GNUNET_CONTAINER_multipeermap_put
+ (void) GNUNET_CONTAINER_multipeermap_put
(sub->observed_unique_peers,
peer,
NULL,
@@ -2836,13 +2836,20 @@ cleanup_destroyed_channel (void *cls,
(void) channel;
channel_ctx->channel = NULL;
- remove_channel_ctx (channel_ctx);
if ((NULL != peer_ctx) &&
(peer_ctx->send_channel_ctx == channel_ctx) &&
- (GNUNET_YES == check_sending_channel_needed (channel_ctx->peer_ctx)) )
+ (GNUNET_YES == check_sending_channel_needed (peer_ctx)) )
{
+ remove_channel_ctx (channel_ctx);
remove_peer (peer_ctx->sub, &peer_ctx->peer_id);
}
+ else
+ {
+ /* We need this if-else construct because we need to make sure the channel
+ * (context) is cleaned up before removing the peer, but still neet to
+ * compare it while checking the condition */
+ remove_channel_ctx (channel_ctx);
+ }
}