aboutsummaryrefslogtreecommitdiff
path: root/src/set/gnunet-service-set_union.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/set/gnunet-service-set_union.c')
-rw-r--r--src/set/gnunet-service-set_union.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index 694fb6056..05b125047 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -364,6 +364,34 @@ destroy_elements (struct UnionState *us)
364} 364}
365 365
366 366
367
368/**
369 * Iterator over hash map entries.
370 *
371 * @param cls closure
372 * @param key current key code
373 * @param value value in the hash map
374 * @return GNUNET_YES if we should continue to
375 * iterate,
376 * GNUNET_NO if not.
377 */
378static int
379destroy_key_to_element_iter (void *cls,
380 uint32_t key,
381 void *value)
382{
383 struct KeyEntry *k = value;
384
385 while (NULL != k)
386 {
387 struct KeyEntry *k_tmp = k;
388 k = k->next_colliding;
389 GNUNET_free (k_tmp);
390 }
391 return GNUNET_YES;
392}
393
394
367/** 395/**
368 * Destroy a union operation, and free all resources 396 * Destroy a union operation, and free all resources
369 * associated with it. 397 * associated with it.
@@ -400,6 +428,7 @@ destroy_union_operation (struct UnionEvaluateOperation *eo)
400 } 428 }
401 if (NULL != eo->key_to_element) 429 if (NULL != eo->key_to_element)
402 { 430 {
431 GNUNET_CONTAINER_multihashmap32_iterate (eo->key_to_element, destroy_key_to_element_iter, NULL);
403 GNUNET_CONTAINER_multihashmap32_destroy (eo->key_to_element); 432 GNUNET_CONTAINER_multihashmap32_destroy (eo->key_to_element);
404 eo->key_to_element = NULL; 433 eo->key_to_element = NULL;
405 } 434 }
@@ -1030,6 +1059,8 @@ handle_p2p_elements (void *cls, const struct GNUNET_MessageHeader *mh)
1030 1059
1031 insert_element (eo, ee); 1060 insert_element (eo, ee);
1032 send_client_element (eo, &ee->element); 1061 send_client_element (eo, &ee->element);
1062
1063 GNUNET_free (ee);
1033} 1064}
1034 1065
1035 1066