aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rps/gnunet-service-rps.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 34acba2fc..fe5db5e6f 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -1388,6 +1388,7 @@ peer_remove_cb (void *cls, const struct GNUNET_PeerIdentity *key, void *value)
1388{ 1388{
1389 struct PeerContext *peer_ctx; 1389 struct PeerContext *peer_ctx;
1390 const struct GNUNET_CADET_Channel *ch = (const struct GNUNET_CADET_Channel *) cls; 1390 const struct GNUNET_CADET_Channel *ch = (const struct GNUNET_CADET_Channel *) cls;
1391 struct GNUNET_CADET_Channel *destroy;
1391 1392
1392 peer_ctx = (struct PeerContext *) value; 1393 peer_ctx = (struct PeerContext *) value;
1393 1394
@@ -1402,11 +1403,19 @@ peer_remove_cb (void *cls, const struct GNUNET_PeerIdentity *key, void *value)
1402 1403
1403 if (NULL != peer_ctx->send_channel 1404 if (NULL != peer_ctx->send_channel
1404 && ch != peer_ctx->send_channel) 1405 && ch != peer_ctx->send_channel)
1405 GNUNET_CADET_channel_destroy (peer_ctx->send_channel); 1406 {
1407 destroy = peer_ctx->send_channel;
1408 peer_ctx->send_channel = NULL;
1409 GNUNET_CADET_channel_destroy (destroy);
1410 }
1406 1411
1407 if (NULL != peer_ctx->recv_channel 1412 if (NULL != peer_ctx->recv_channel
1408 && ch != peer_ctx->recv_channel) 1413 && ch != peer_ctx->recv_channel)
1409 GNUNET_CADET_channel_destroy (peer_ctx->recv_channel); 1414 {
1415 destroy = peer_ctx->recv_channel;
1416 peer_ctx->recv_channel = NULL;
1417 GNUNET_CADET_channel_destroy (destroy);
1418 }
1410 1419
1411 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_remove_all (peer_map, key)) 1420 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_remove_all (peer_map, key))
1412 LOG (GNUNET_ERROR_TYPE_WARNING, "removing peer from peer_map failed\n"); 1421 LOG (GNUNET_ERROR_TYPE_WARNING, "removing peer from peer_map failed\n");