fixing leak
authorChristian Grothoff <christian@grothoff.org>
Thu, 28 Apr 2011 17:20:22 +0000 (17:20 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 28 Apr 2011 17:20:22 +0000 (17:20 +0000)
TODO
src/core/core_api.c

diff --git a/TODO b/TODO
index 4463244338c4d885775813785460b3f7c88f9ccf..58eb3e8b6e05d4f04d46f44a60f6811d5e9d2d87 100644 (file)
--- 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
index 1d61cf96ba8c1b8b94a4edc4c7f16eb3c8eadfb1..195e94e29d0dcf56a8cda2491dbb669b2c9ab4a0 100644 (file)
@@ -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'?
 }