From 28061a2a790460a7e27e292cddfce47d6a02d63f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 17 Feb 2010 14:42:56 +0000 Subject: [PATCH] leaks --- src/topology/gnunet-daemon-topology.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index 1546dc764..30ad925a7 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c @@ -507,6 +507,9 @@ free_peer (struct PeerList *peer) if (pos->hello_delay_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel (sched, pos->hello_delay_task); + GNUNET_free_non_null (pos->hello); + if (pos->filter != NULL) + GNUNET_CONTAINER_bloomfilter_free (peer->filter); GNUNET_free (pos); } @@ -841,7 +844,6 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello) if (peer == NULL) peer = make_peer (&pid, hello, GNUNET_NO); // FIXME: check if 'hello' is any different from peer->hello? - GNUNET_free_non_null (peer->hello); #if DEBUG_TOPOLOGY GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found `%s' from peer `%s' for advertising\n", @@ -849,6 +851,7 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello) GNUNET_i2s (&pid)); #endif size = GNUNET_HELLO_size (hello); + GNUNET_free_non_null (peer->hello); peer->hello = GNUNET_malloc (size); memcpy (peer->hello, hello, size); if (peer->filter != NULL) -- 2.25.1