summaryrefslogtreecommitdiff
path: root/src/rps/gnunet-service-rps_sampler.c
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2015-06-10 11:01:46 +0000
committerJulius Bünger <buenger@mytum.de>2015-06-10 11:01:46 +0000
commit11ca82f4300e03a0fd82e1507b3f1fc9aefbbabd (patch)
tree1578b63dfc3c429208d686efd4e3ec8331255d71 /src/rps/gnunet-service-rps_sampler.c
parent83da6bcc7751ee11905e3f8f3adcfe33d2b926bc (diff)
-fix coverity
Diffstat (limited to 'src/rps/gnunet-service-rps_sampler.c')
-rw-r--r--src/rps/gnunet-service-rps_sampler.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c
index 88709d465..ed3677e8c 100644
--- a/src/rps/gnunet-service-rps_sampler.c
+++ b/src/rps/gnunet-service-rps_sampler.c
@@ -600,9 +600,6 @@ static void
sampler_empty (struct RPS_Sampler *sampler)
{
sampler_resize (sampler, 0);
- GNUNET_array_grow (sampler->trash_can,
- sampler->trash_can_size,
- 0);
}
@@ -923,6 +920,8 @@ RPS_sampler_get_n_rand_peers (struct RPS_Sampler *sampler,
void *cls, uint32_t num_peers)
{
GNUNET_assert (0 != sampler->sampler_size);
+ if (0 == num_peers)
+ return;
// TODO check if we have too much (distinct) sampled peers
uint32_t i;