diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 2762339ae..4f4214248 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -1389,7 +1389,8 @@ peer_remove_cb (void *cls, const struct GNUNET_PeerIdentity *key, void *value) | |||
1389 | { | 1389 | { |
1390 | struct PeerContext *peer_ctx; | 1390 | struct PeerContext *peer_ctx; |
1391 | const struct GNUNET_CADET_Channel *ch = (const struct GNUNET_CADET_Channel *) cls; | 1391 | const struct GNUNET_CADET_Channel *ch = (const struct GNUNET_CADET_Channel *) cls; |
1392 | struct GNUNET_CADET_Channel *destroy; | 1392 | struct GNUNET_CADET_Channel *recv; |
1393 | struct GNUNET_CADET_Channel *send; | ||
1393 | 1394 | ||
1394 | peer_ctx = (struct PeerContext *) value; | 1395 | peer_ctx = (struct PeerContext *) value; |
1395 | 1396 | ||
@@ -1402,25 +1403,27 @@ peer_remove_cb (void *cls, const struct GNUNET_PeerIdentity *key, void *value) | |||
1402 | peer_ctx->is_live_task = NULL; | 1403 | peer_ctx->is_live_task = NULL; |
1403 | } | 1404 | } |
1404 | 1405 | ||
1405 | if (NULL != peer_ctx->send_channel | 1406 | send = peer_ctx->send_channel; |
1406 | && ch != peer_ctx->send_channel) | 1407 | peer_ctx->send_channel = NULL; |
1408 | recv = peer_ctx->send_channel; | ||
1409 | peer_ctx->recv_channel = NULL; | ||
1410 | |||
1411 | if (NULL != send | ||
1412 | && ch != send) | ||
1407 | { | 1413 | { |
1408 | destroy = peer_ctx->send_channel; | 1414 | GNUNET_CADET_channel_destroy (send); |
1409 | peer_ctx->send_channel = NULL; | ||
1410 | GNUNET_CADET_channel_destroy (destroy); | ||
1411 | } | 1415 | } |
1412 | 1416 | ||
1413 | if (NULL != peer_ctx->recv_channel | 1417 | if (NULL != recv |
1414 | && ch != peer_ctx->recv_channel) | 1418 | && ch != recv) |
1415 | { | 1419 | { |
1416 | destroy = peer_ctx->recv_channel; | 1420 | GNUNET_CADET_channel_destroy (recv); |
1417 | peer_ctx->recv_channel = NULL; | ||
1418 | GNUNET_CADET_channel_destroy (destroy); | ||
1419 | } | 1421 | } |
1420 | 1422 | ||
1421 | if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_remove_all (peer_map, key)) | 1423 | if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_remove_all (peer_map, key)) |
1422 | LOG (GNUNET_ERROR_TYPE_WARNING, "removing peer from peer_map failed\n"); | 1424 | LOG (GNUNET_ERROR_TYPE_WARNING, "removing peer from peer_map failed\n"); |
1423 | 1425 | ||
1426 | /* FIXME this will be called twice until the fixme in line 1451 is fixed */ | ||
1424 | GNUNET_free (peer_ctx); | 1427 | GNUNET_free (peer_ctx); |
1425 | return GNUNET_YES; | 1428 | return GNUNET_YES; |
1426 | } | 1429 | } |