From: Christian Grothoff Date: Thu, 4 Jan 2018 20:51:53 +0000 (+0100) Subject: fix memory leak X-Git-Tag: gnunet-0.11.0rc0~16^2~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2847375361c620cbd6498fef5f051955786edb59;p=oweals%2Fgnunet.git fix memory leak --- diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h index a2999aebc..0c14aa945 100644 --- a/src/include/gnunet_set_service.h +++ b/src/include/gnunet_set_service.h @@ -530,6 +530,7 @@ GNUNET_SET_iterate (struct GNUNET_SET_Handle *set, GNUNET_SET_ElementIterator iter, void *iter_cls); + /** * Stop iteration over all elements in the given set. Can only * be called before the iteration has "naturally" completed its @@ -540,6 +541,7 @@ GNUNET_SET_iterate (struct GNUNET_SET_Handle *set, void GNUNET_SET_iterate_cancel (struct GNUNET_SET_Handle *set); + /** * Create a copy of an element. The copy * must be GNUNET_free-d by the caller. @@ -550,6 +552,7 @@ GNUNET_SET_iterate_cancel (struct GNUNET_SET_Handle *set); struct GNUNET_SET_Element * GNUNET_SET_element_dup (const struct GNUNET_SET_Element *element); + /** * Hash a set element. * diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c index 8281e9a16..23f654141 100644 --- a/src/revocation/gnunet-service-revocation.c +++ b/src/revocation/gnunet-service-revocation.c @@ -759,7 +759,11 @@ handle_revocation_union_request (void *cls, { peer_entry = new_peer_entry (other_peer); } - GNUNET_assert (NULL == peer_entry->so); + if (NULL != peer_entry->so) + { + GNUNET_break_op (0); + return; + } peer_entry->so = GNUNET_SET_accept (request, GNUNET_SET_RESULT_ADDED, (struct GNUNET_SET_Option[]) {{ 0 }}, @@ -769,8 +773,7 @@ handle_revocation_union_request (void *cls, GNUNET_SET_commit (peer_entry->so, revocation_set)) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - _("SET service crashed, terminating revocation service\n")); + GNUNET_break (0); GNUNET_SCHEDULER_shutdown (); return; } diff --git a/src/testbed/gnunet-daemon-testbed-blacklist.c b/src/testbed/gnunet-daemon-testbed-blacklist.c index f2f96ee09..3ebe20258 100644 --- a/src/testbed/gnunet-daemon-testbed-blacklist.c +++ b/src/testbed/gnunet-daemon-testbed-blacklist.c @@ -190,7 +190,8 @@ run (void *cls, char *fname; if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_filename (c, "PATHS", + GNUNET_CONFIGURATION_get_value_filename (c, + "PATHS", "GNUNET_HOME", &shome)) { @@ -208,6 +209,7 @@ run (void *cls, GNUNET_free (fname); return; } + GNUNET_free (fname); GNUNET_asprintf (&fname, "%s/blacklist", shome);