From d40d816c06ec13ad22130e2f6be4a22ea673b1aa Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 28 Apr 2011 17:20:22 +0000 Subject: fixing leak --- TODO | 2 -- src/core/core_api.c | 11 +++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 446324433..58eb3e8b6 100644 --- a/TODO +++ b/TODO @@ -8,8 +8,6 @@ * Transport: - ATS crashes [MW] - UDP fragmentation [MW] -* CORE: - - Core API's notify_transmit_ready leaks 'th'! * FS [CG] - download of 100 MB file from 'leach' peer hung due to failure of core-api to call back after a change preference request diff --git a/src/core/core_api.c b/src/core/core_api.c index 1d61cf96b..195e94e29 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -736,7 +736,8 @@ transmit_message (void *cls, #endif /* client decided to send nothing! */ request_next_transmission (pr); - return 0; + GNUNET_free (th); + return 0; } #if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -748,7 +749,8 @@ transmit_message (void *cls, { GNUNET_break (0); request_next_transmission (pr); - return 0; + GNUNET_free (th); + return 0; } ret += sizeof (struct SendMessage); sm->header.size = htons (ret); @@ -1582,6 +1584,7 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Dropping transmission request: priority too low\n"); #endif + GNUNET_free(th); return NULL; /* priority too low */ } GNUNET_CONTAINER_DLL_remove (pr->pending_head, @@ -1762,7 +1765,8 @@ GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, &peer->hashPubKey)) { #if DEBUG_CORE - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peers are already connected!\n"); + GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, + "Peers are already connected!\n"); #endif return NULL; } @@ -1851,7 +1855,6 @@ change_preference_send_continuation (void *cls, struct GNUNET_CORE_InformationRequestContext *irc = cls; irc->cm = NULL; - // FIXME: who frees 'irc'? } -- cgit v1.2.3