/*
This file is part of GNUnet
- Copyright (C) 2012 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2012 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUNET_free_non_null (dbuf);
return GNUNET_SYSERR;
}
+
for (i = 0; i < se->strata_count; i++)
{
ibf_read_slice (buf, 0, se->ibf_size, se->strata[i]);
se->strata[i] = ibf_create (ibf_size, ibf_hashnum);
if (NULL == se->strata[i])
{
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to allocate memory for strata estimator\n");
for (j = 0; j < i; j++)
ibf_destroy (se->strata[i]);
GNUNET_free (se);
c = GNUNET_new (struct StrataEstimator);
c->strata_count = se->strata_count;
c->ibf_size = se->ibf_size;
- c->strata = GNUNET_malloc (sizeof (struct InvertibleBloomFilter *) * se->strata_count);
+ c->strata = GNUNET_new_array (se->strata_count,
+ struct InvertibleBloomFilter *);
for (i = 0; i < se->strata_count; i++)
c->strata[i] = ibf_dup (se->strata[i]);
return c;