From: David Barksdale Date: Tue, 10 Oct 2017 02:42:12 +0000 (-0500) Subject: Fix memory leak in test_core_api_reliability X-Git-Tag: gnunet-0.11.0rc0~102^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=45140f0fd3426e9689c6d1e5e758f1b75c450e90;p=oweals%2Fgnunet.git Fix memory leak in test_core_api_reliability --- diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index 900c9f732..528093c99 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -381,6 +381,7 @@ process_hello (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received (my) `%s' from transport service\n", "HELLO"); GNUNET_assert (message != NULL); + GNUNET_free_non_null (p->hello); p->hello = GNUNET_copy_message (message); if ((p == &p1) && (NULL == p2.oh)) p2.oh = GNUNET_TRANSPORT_offer_hello (p2.cfg, @@ -518,6 +519,8 @@ main (int argc, &ok); stop_arm (&p1); stop_arm (&p2); + GNUNET_free_non_null (p1.hello); + GNUNET_free_non_null (p2.hello); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1"); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2");