aboutsummaryrefslogtreecommitdiff
path: root/src/rps/gnunet-service-rps_custommap.c
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-03-05 18:29:25 +0100
committerJulius Bünger <buenger@mytum.de>2018-03-05 18:34:36 +0100
commite1534af8705146a702e69f836969b6e8a9e6d495 (patch)
treeabf0cdf90cd71ab5f055c47fcbdeaa601657eb2d /src/rps/gnunet-service-rps_custommap.c
parent6c10bf3ecacc9701c0f189200dc66dbef00ed46d (diff)
downloadgnunet-e1534af8705146a702e69f836969b6e8a9e6d495.tar.gz
gnunet-e1534af8705146a702e69f836969b6e8a9e6d495.zip
rps: fixes
Diffstat (limited to 'src/rps/gnunet-service-rps_custommap.c')
-rw-r--r--src/rps/gnunet-service-rps_custommap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rps/gnunet-service-rps_custommap.c b/src/rps/gnunet-service-rps_custommap.c
index 064192d08..aef081a00 100644
--- a/src/rps/gnunet-service-rps_custommap.c
+++ b/src/rps/gnunet-service-rps_custommap.c
@@ -128,7 +128,9 @@ CustomPeerMap_put (const struct CustomPeerMap *c_peer_map,
128 *index = CustomPeerMap_size (c_peer_map); 128 *index = CustomPeerMap_size (c_peer_map);
129 p = GNUNET_new (struct GNUNET_PeerIdentity); 129 p = GNUNET_new (struct GNUNET_PeerIdentity);
130 *p = *peer; 130 *p = *peer;
131 GNUNET_CONTAINER_multipeermap_put (c_peer_map->peer_map, peer, index, 131 GNUNET_assert (p != peer);
132 GNUNET_assert (0 == memcmp (p, peer, sizeof(struct GNUNET_PeerIdentity)));
133 GNUNET_CONTAINER_multipeermap_put (c_peer_map->peer_map, p, index,
132 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); 134 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
133 GNUNET_CONTAINER_multihashmap32_put (c_peer_map->hash_map, *index, p, 135 GNUNET_CONTAINER_multihashmap32_put (c_peer_map->hash_map, *index, p,
134 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); 136 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
@@ -218,7 +220,6 @@ CustomPeerMap_remove_peer (const struct CustomPeerMap *c_peer_map,
218 *last_index = *index; 220 *last_index = *index;
219 } 221 }
220 GNUNET_free (index); 222 GNUNET_free (index);
221 GNUNET_free (p);
222 GNUNET_assert (GNUNET_CONTAINER_multihashmap32_size (c_peer_map->hash_map) == 223 GNUNET_assert (GNUNET_CONTAINER_multihashmap32_size (c_peer_map->hash_map) ==
223 GNUNET_CONTAINER_multipeermap_size (c_peer_map->peer_map)); 224 GNUNET_CONTAINER_multipeermap_size (c_peer_map->peer_map));
224 return GNUNET_OK; 225 return GNUNET_OK;