diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-08 12:12:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-08 12:12:25 +0000 |
commit | 9b6eafa38e02ace11cc6217efee78e95b82eb19e (patch) | |
tree | 5bbaa2194b0809f34c2d51226ac28ad8f81ed975 /src/set/gnunet-service-set_union_strata_estimator.c | |
parent | e04e8965d95b5e2e8331140e204b578cdb2d74ba (diff) | |
download | gnunet-9b6eafa38e02ace11cc6217efee78e95b82eb19e.tar.gz gnunet-9b6eafa38e02ace11cc6217efee78e95b82eb19e.zip |
-fix
Diffstat (limited to 'src/set/gnunet-service-set_union_strata_estimator.c')
-rw-r--r-- | src/set/gnunet-service-set_union_strata_estimator.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/set/gnunet-service-set_union_strata_estimator.c b/src/set/gnunet-service-set_union_strata_estimator.c index 59d81e134..324d9d311 100644 --- a/src/set/gnunet-service-set_union_strata_estimator.c +++ b/src/set/gnunet-service-set_union_strata_estimator.c | |||
@@ -33,7 +33,7 @@ | |||
33 | * Should we try compressing the strata estimator? This will | 33 | * Should we try compressing the strata estimator? This will |
34 | * break compatibility with the 0.10.1-network. | 34 | * break compatibility with the 0.10.1-network. |
35 | */ | 35 | */ |
36 | #define FAIL_10_1_COMPATIBILTIY 1 | 36 | #define FAIL_10_1_COMPATIBILTIY 0 |
37 | 37 | ||
38 | 38 | ||
39 | /** | 39 | /** |
@@ -123,6 +123,7 @@ strata_estimator_read (const void *buf, | |||
123 | GNUNET_free_non_null (dbuf); | 123 | GNUNET_free_non_null (dbuf); |
124 | return GNUNET_SYSERR; | 124 | return GNUNET_SYSERR; |
125 | } | 125 | } |
126 | |||
126 | for (i = 0; i < se->strata_count; i++) | 127 | for (i = 0; i < se->strata_count; i++) |
127 | { | 128 | { |
128 | ibf_read_slice (buf, 0, se->ibf_size, se->strata[i]); | 129 | ibf_read_slice (buf, 0, se->ibf_size, se->strata[i]); |
@@ -202,6 +203,8 @@ strata_estimator_create (unsigned int strata_count, | |||
202 | se->strata[i] = ibf_create (ibf_size, ibf_hashnum); | 203 | se->strata[i] = ibf_create (ibf_size, ibf_hashnum); |
203 | if (NULL == se->strata[i]) | 204 | if (NULL == se->strata[i]) |
204 | { | 205 | { |
206 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
207 | "Failed to allocate memory for strata estimator\n"); | ||
205 | for (j = 0; j < i; j++) | 208 | for (j = 0; j < i; j++) |
206 | ibf_destroy (se->strata[i]); | 209 | ibf_destroy (se->strata[i]); |
207 | GNUNET_free (se); | 210 | GNUNET_free (se); |
@@ -277,7 +280,8 @@ strata_estimator_dup (struct StrataEstimator *se) | |||
277 | c = GNUNET_new (struct StrataEstimator); | 280 | c = GNUNET_new (struct StrataEstimator); |
278 | c->strata_count = se->strata_count; | 281 | c->strata_count = se->strata_count; |
279 | c->ibf_size = se->ibf_size; | 282 | c->ibf_size = se->ibf_size; |
280 | c->strata = GNUNET_malloc (sizeof (struct InvertibleBloomFilter *) * se->strata_count); | 283 | c->strata = GNUNET_new_array (se->strata_count, |
284 | struct InvertibleBloomFilter *); | ||
281 | for (i = 0; i < se->strata_count; i++) | 285 | for (i = 0; i < se->strata_count; i++) |
282 | c->strata[i] = ibf_dup (se->strata[i]); | 286 | c->strata[i] = ibf_dup (se->strata[i]); |
283 | return c; | 287 | return c; |