diff options
author | Julius Bünger <buenger@mytum.de> | 2021-03-29 21:29:27 +0200 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2021-03-29 21:29:27 +0200 |
commit | 29be7985d06482beec4304b0f2eb57f23b6ec84d (patch) | |
tree | db524a0b73de6a2a937105940c29b465ecc85cde | |
parent | 0010646bbdeba3ceaebe478db977944560e3faaa (diff) | |
download | gnunet-29be7985d06482beec4304b0f2eb57f23b6ec84d.tar.gz gnunet-29be7985d06482beec4304b0f2eb57f23b6ec84d.zip |
-rps: fix bugs
-rw-r--r-- | src/rps/gnunet-service-rps.c | 5 | ||||
-rw-r--r-- | src/rps/rps-test_util.c | 16 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index cccd1a4b3..56eab288e 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -965,8 +965,6 @@ remove_channel_ctx (struct ChannelCtx *channel_ctx) | |||
965 | channel_ctx->destruction_task = NULL; | 965 | channel_ctx->destruction_task = NULL; |
966 | } | 966 | } |
967 | 967 | ||
968 | GNUNET_free (channel_ctx); | ||
969 | |||
970 | if (NULL == peer_ctx) | 968 | if (NULL == peer_ctx) |
971 | return; | 969 | return; |
972 | if (channel_ctx == peer_ctx->send_channel_ctx) | 970 | if (channel_ctx == peer_ctx->send_channel_ctx) |
@@ -978,6 +976,7 @@ remove_channel_ctx (struct ChannelCtx *channel_ctx) | |||
978 | { | 976 | { |
979 | peer_ctx->recv_channel_ctx = NULL; | 977 | peer_ctx->recv_channel_ctx = NULL; |
980 | } | 978 | } |
979 | GNUNET_free (channel_ctx); | ||
981 | } | 980 | } |
982 | 981 | ||
983 | 982 | ||
@@ -2802,7 +2801,7 @@ clean_peer (struct Sub *sub, | |||
2802 | peer))) && | 2801 | peer))) && |
2803 | (GNUNET_NO == View_contains_peer (sub->view, peer)) && | 2802 | (GNUNET_NO == View_contains_peer (sub->view, peer)) && |
2804 | (GNUNET_NO == CustomPeerMap_contains_peer (sub->push_map, peer)) && | 2803 | (GNUNET_NO == CustomPeerMap_contains_peer (sub->push_map, peer)) && |
2805 | (GNUNET_NO == CustomPeerMap_contains_peer (sub->push_map, peer)) && | 2804 | (GNUNET_NO == CustomPeerMap_contains_peer (sub->pull_map, peer)) && |
2806 | (0 == RPS_sampler_count_id (sub->sampler, peer)) && | 2805 | (0 == RPS_sampler_count_id (sub->sampler, peer)) && |
2807 | (GNUNET_YES == check_removable (get_peer_ctx (sub->peer_map, peer)))) | 2806 | (GNUNET_YES == check_removable (get_peer_ctx (sub->peer_map, peer)))) |
2808 | { /* We can safely remove this peer */ | 2807 | { /* We can safely remove this peer */ |
diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c index 497225973..6dee20c95 100644 --- a/src/rps/rps-test_util.c +++ b/src/rps/rps-test_util.c | |||
@@ -152,12 +152,16 @@ close_all_files () | |||
152 | { | 152 | { |
153 | int ret; | 153 | int ret; |
154 | 154 | ||
155 | ret = GNUNET_CONTAINER_multihashmap_iterate (open_files, | 155 | if (NULL != open_files) |
156 | close_files_iter, | 156 | { |
157 | NULL); | 157 | ret = GNUNET_CONTAINER_multihashmap_iterate (open_files, |
158 | GNUNET_CONTAINER_multihashmap_destroy (open_files); | 158 | close_files_iter, |
159 | open_files = NULL; | 159 | NULL); |
160 | return ret; | 160 | GNUNET_CONTAINER_multihashmap_destroy (open_files); |
161 | open_files = NULL; | ||
162 | return ret; | ||
163 | } | ||
164 | return GNUNET_YES; | ||
161 | } | 165 | } |
162 | 166 | ||
163 | 167 | ||