From c46a23c5148d7cb40ba9a7fb3bd3b5bf4229c990 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Thu, 15 Sep 2016 00:58:39 +0000 Subject: [PATCH] -rps: check return values --- src/rps/gnunet-service-rps.c | 2 +- src/rps/gnunet-service-rps_custommap.c | 4 +++- src/rps/test_rps.c | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index c1211db68..9af933dfd 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c @@ -771,7 +771,7 @@ check_sending_channel_needed (const struct GNUNET_PeerIdentity *peer) static void remove_peer (const struct GNUNET_PeerIdentity *peer) { - View_remove_peer (peer); + (void) View_remove_peer (peer); CustomPeerMap_remove_peer (pull_map, peer); CustomPeerMap_remove_peer (push_map, peer); RPS_sampler_reinitialise_by_value (prot_sampler, peer); diff --git a/src/rps/gnunet-service-rps_custommap.c b/src/rps/gnunet-service-rps_custommap.c index 158dcc43c..064192d08 100644 --- a/src/rps/gnunet-service-rps_custommap.c +++ b/src/rps/gnunet-service-rps_custommap.c @@ -297,7 +297,9 @@ CustomPeerMap_clear (const struct CustomPeerMap *c_peer_map) GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_multihashmap32_contains (c_peer_map->hash_map, CustomPeerMap_size (c_peer_map) -1)); - CustomPeerMap_remove_peer_by_index (c_peer_map, CustomPeerMap_size (c_peer_map) -1); + GNUNET_assert (GNUNET_OK == + CustomPeerMap_remove_peer_by_index (c_peer_map, + CustomPeerMap_size (c_peer_map) -1)); } GNUNET_assert (0 == CustomPeerMap_size (c_peer_map)); } diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index a107aa042..1ce174454 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c @@ -593,10 +593,11 @@ info_cb (void *cb_cls, rps_peer_ids[entry->index] = *(pinfo->result.id); rps_peers[entry->index].peer_id = &rps_peer_ids[entry->index]; - GNUNET_CONTAINER_multipeermap_put (peer_map, - &rps_peer_ids[entry->index], - &rps_peers[entry->index], - GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); + GNUNET_assert (GNUNET_OK == + GNUNET_CONTAINER_multipeermap_put (peer_map, + &rps_peer_ids[entry->index], + &rps_peers[entry->index], + GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); tofile ("/tmp/rps/peer_ids", "%u\t%s\n", entry->index, -- 2.25.1