From: Florian Dold Date: Mon, 12 Aug 2013 15:16:15 +0000 (+0000) Subject: - test memory leak X-Git-Tag: initial-import-from-subversion-38251~7902 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a345e89e5993856aa6780e24c0e580c10b50c4a1;p=oweals%2Fgnunet.git - test memory leak --- diff --git a/src/util/container_multihashmap.c b/src/util/container_multihashmap.c index 1cd699dff..9ef8f74a4 100644 --- a/src/util/container_multihashmap.c +++ b/src/util/container_multihashmap.c @@ -840,7 +840,7 @@ int GNUNET_CONTAINER_multihashmap_iterator_next (struct GNUNET_CONTAINER_MultiHashMapIterator *iter, struct GNUNET_HashCode *key, const void **value) { - /* make sure nobody modified the map */ + /* make sure the map has not been modified */ GNUNET_assert (iter->modification_counter == iter->map->modification_counter); /* look for the next entry, skipping empty buckets */ @@ -883,7 +883,7 @@ GNUNET_CONTAINER_multihashmap_iterator_next (struct GNUNET_CONTAINER_MultiHashMa * @param iter the iterator to destroy */ void -GNUNET_CONTAINER_multihashmap_enumerator_destroy (struct GNUNET_CONTAINER_MultiHashMapIterator *iter) +GNUNET_CONTAINER_multihashmap_iterator_destroy (struct GNUNET_CONTAINER_MultiHashMapIterator *iter) { GNUNET_free (iter); } diff --git a/src/util/test_container_multihashmap.c b/src/util/test_container_multihashmap.c index a0d29c606..6b079a109 100644 --- a/src/util/test_container_multihashmap.c +++ b/src/util/test_container_multihashmap.c @@ -87,6 +87,7 @@ testMap (int i) CHECK (GNUNET_YES == GNUNET_CONTAINER_multihashmap_iterator_next (iter, &key_ret, (const void **)&ret)); CHECK (0 == memcmp (&key_ret, &k1, sizeof (key_ret))); CHECK (GNUNET_NO == GNUNET_CONTAINER_multihashmap_iterator_next (iter, NULL, NULL)); + GNUNET_free (iter); CHECK (2 == GNUNET_CONTAINER_multihashmap_remove_all (m, &k1)); for (j = 0; j < 1024; j++) @@ -97,6 +98,7 @@ testMap (int i) for (j = 0; j < GNUNET_CONTAINER_multihashmap_size (m); j++) CHECK (GNUNET_YES == GNUNET_CONTAINER_multihashmap_iterator_next (iter, NULL, NULL)); CHECK (GNUNET_NO == GNUNET_CONTAINER_multihashmap_iterator_next (iter, NULL, NULL)); + GNUNET_free (iter); GNUNET_CONTAINER_multihashmap_destroy (m); return 0;